Ask Your Question
0

Bug? opencv_test_imgproc fails, wrong path to test file

asked 2017-02-19 18:33:43 -0600

Netsai Chibuku gravatar image

OpenCV 3.x opencv_test_imgproc fails, because some OpenCL tests try to open nonexistent files (eg. "gpu/opticalflow/rubberwhale1.png"). The files are actually in "sources/samples/data" directory. So it seems the paths in the source has not been updated. Affects at least 3.0 and 3.2.

Before I open a bug, I want to check if there is some other cause... like I missed some file copying step in building and testing, or maybe I am building old (deprecated) tests somehow. The source files concerned are:

C:\OpenCV3.2.0\sources\modules\imgproc\perf\opencl\perf_gftt.cpp(60): ::testing::Combine(OCL_PERF_ENUM(String("gpu/opticalflow/rubberwhale1.png")),

C:\OpenCV3.2.0\sources\modules\video\perf\opencl\perf_optflow_farneback.cpp(74): Mat frame0 = imread(getDataPath("gpu/opticalflow/rubberwhale1.png"), cv::IMREAD_GRAYSCALE);

C:\OpenCV3.2.0\sources\modules\video\perf\opencl\perf_optflow_farneback.cpp(77): Mat frame1 = imread(getDataPath("gpu/opticalflow/rubberwhale2.png"), cv::IMREAD_GRAYSCALE);

C:\OpenCV3.2.0\sources\modules\video\perf\opencl\perf_optflow_pyrlk.cpp(64): Mat frame0 = imread(getDataPath("gpu/opticalflow/rubberwhale1.png"), cv::IMREAD_GRAYSCALE);

C:\OpenCV3.2.0\sources\modules\video\perf\opencl\perf_optflow_pyrlk.cpp(67): Mat frame1 = imread(getDataPath("gpu/opticalflow/rubberwhale2.png"), cv::IMREAD_GRAYSCALE);

C:\OpenCV3.2.0\sources\modules\imgproc\test\ocl\test_gftt.cpp(74): Mat frame = readImage("../gpu/opticalflow/rubberwhale1.png", IMREAD_GRAYSCALE);

C:\OpenCV3.2.0\sources\modules\imgproc\test\ocl\test_gftt.cpp(75): ASSERT_FALSE(frame.empty()) << "could not load gpu/opticalflow/rubberwhale1.png";

Netsai

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-20 01:18:23 -0600

LBerger gravatar image

No It is not a bug. You have to set DOWNLOAD_EXTERNAL_TEST_DATA to true in CMake and set variable OPENCV_TEST_DATA_PATH in your system environment

edit flag offensive delete link more

Comments

while it is expected, that those tests fail, due to missing data, the perf_optflow_farneback test crashes here (it shouldn't !)

berak gravatar imageberak ( 2017-02-20 03:39:21 -0600 )edit

Thank you. For me, setting DOWNLOAD_EXTERNAL_TEST_DATA to true did not download anything, and actually I cannot see any references in build files to DOWNLOAD_EXTERNAL_TEST_DATA that have any effect. So maybe there is a bug after all.

I made a manual git clone of https://github.com/opencv/opencv_extra and set OPENCV_TEST_DATA_PATH to point to it, then the tests pass.

Netsai Chibuku gravatar imageNetsai Chibuku ( 2017-02-20 16:29:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-02-19 18:33:43 -0600

Seen: 329 times

Last updated: Feb 20 '17