Skip to content

Commit 90e997f

Browse files
committed
stereo: fix loading images in tests
1 parent c8f2d2b commit 90e997f

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

modules/stereo/test/test_block_matching.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,9 @@ static double errorLevel(const Mat &ideal, Mat &actual)
8383
void CV_BlockMatchingTest::run(int )
8484
{
8585
Mat image1, image2, gt;
86-
//some test images can be found in the test data folder
87-
//in order for the tests to build succesfully please replace
88-
//ts->get_data_path() + "testdata/imL2l.bmp with the path from your disk
89-
//for example if your images are on D:\\ , please write D:\\testdata\\imL2l.bmp
90-
image1 = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1);
91-
image2 = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
92-
gt = imread(ts->get_data_path() + "testdata/groundtruth.bmp", CV_8UC1);
86+
image1 = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/im2.png", IMREAD_GRAYSCALE);
87+
image2 = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/im6.png", IMREAD_GRAYSCALE);
88+
gt = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/disp2.png", IMREAD_GRAYSCALE);
9389

9490
if(image1.empty() || image2.empty() || gt.empty())
9591
{
@@ -169,10 +165,9 @@ CV_SGBlockMatchingTest::~CV_SGBlockMatchingTest(){}
169165
void CV_SGBlockMatchingTest::run(int )
170166
{
171167
Mat image1, image2, gt;
172-
//some test images can be found in the test data folder
173-
image1 = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1);
174-
image2 = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
175-
gt = imread(ts->get_data_path() + "testdata/groundtruth.bmp", CV_8UC1);
168+
image1 = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/im2.png", IMREAD_GRAYSCALE);
169+
image2 = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/im6.png", IMREAD_GRAYSCALE);
170+
gt = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/disp2.png", IMREAD_GRAYSCALE);
176171

177172

178173
if(image1.empty() || image2.empty() || gt.empty())

modules/stereo/test/test_descriptors.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,8 @@ CV_DescriptorBaseTest::~CV_DescriptorBaseTest()
115115
CV_DescriptorBaseTest::CV_DescriptorBaseTest()
116116
{
117117
//read 2 images from file
118-
//some test images can be found in the test data folder
119-
//in order for the tests to build succesfully please replace
120-
//ts->get_data_path() + "testdata/imL2l.bmp with the path from your disk
121-
//for example if your images are on D:\\ , please write D:\\testdata\\imL2l.bmp
122-
left = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1);
123-
right = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
118+
left = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/im2.png", IMREAD_GRAYSCALE);
119+
right = imread(ts->get_data_path() + "stereomatching/datasets/tsukuba/im6.png", IMREAD_GRAYSCALE);
124120

125121
if(left.empty() || right.empty())
126122
{

0 commit comments

Comments
 (0)