Skip to content

Commit e7ab49e

Browse files
committed
changed the speckle vectors to mats and added comments
1 parent a102eeb commit e7ab49e

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

modules/stereo/src/matching.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,12 @@ namespace cv
359359
};
360360
protected:
361361
//arrays used in the region removal
362-
int *specklePointX;
363-
int *specklePointY;
364-
long long *pus;
362+
Mat speckleY;
363+
Mat speckleX;
364+
Mat puss;
365+
//int *specklePointX;
366+
//int *specklePointY;
367+
//long long *pus;
365368
int previous_size;
366369
//!method for setting the maximum disparity
367370
void setMaxDisparity(int val)
@@ -470,6 +473,9 @@ namespace cv
470473
CV_Assert(currentMap.cols == out.cols);
471474
CV_Assert(currentMap.rows == out.rows);
472475
CV_Assert(t >= 0);
476+
int *pus = (int *)puss.data;
477+
int *specklePointX = (int *)speckleX.data;
478+
int *specklePointY = (int *)speckleY.data;
473479
memset(pus, 0, previous_size * sizeof(pus[0]));
474480
uint8_t *map = currentMap.data;
475481
uint8_t *outputMap = out.data;

modules/stereo/src/stereo_binary_bm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ namespace cv
328328
if(previous_size != width * height)
329329
{
330330
previous_size = width * height;
331-
specklePointX = new int[width * height];
332-
specklePointY = new int[width * height];
333-
pus = new long long[width * height];
331+
speckleX.create(height,width,CV_32SC4);
332+
speckleY.create(height,width,CV_32SC4);
333+
puss.create(height,width,CV_32SC4);
334334

335335
censusImage[0].create(left0.rows,left0.cols,CV_32SC4);
336336
censusImage[1].create(left0.rows,left0.cols,CV_32SC4);

modules/stereo/src/stereo_binary_sgbm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,9 @@ namespace cv
697697
if(previous_size != width * height)
698698
{
699699
previous_size = width * height;
700-
specklePointX = new int[width * height];
701-
specklePointY = new int[width * height];
702-
pus = new long long[width * height];
700+
speckleX.create(height,width,CV_32SC4);
701+
speckleY.create(height,width,CV_32SC4);
702+
puss.create(height,width,CV_32SC4);
703703
}
704704
double minVal; double maxVal;
705705
Mat imgDisparity8U2;

modules/stereo/test/test_block_matching.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ void CV_BlockMatchingTest::run(int )
8484
{
8585
Mat image1, image2, gt;
8686
//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
8790
image1 = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1);
8891
image2 = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
8992
gt = imread(ts->get_data_path() + "testdata/groundtruth.bmp", CV_8UC1);

modules/stereo/test/test_descriptors.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ CV_DescriptorBaseTest::~CV_DescriptorBaseTest()
115115
CV_DescriptorBaseTest::CV_DescriptorBaseTest()
116116
{
117117
//read 2 images from file
118-
//two test images can be found in the test data folder
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
119122
left = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1);
120123
right = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
121124

0 commit comments

Comments
 (0)