Commit e7ab49eb authored by Muresan Mircea Paul's avatar Muresan Mircea Paul

changed the speckle vectors to mats and added comments

parent a102eeb1
...@@ -359,9 +359,12 @@ namespace cv ...@@ -359,9 +359,12 @@ namespace cv
}; };
protected: protected:
//arrays used in the region removal //arrays used in the region removal
int *specklePointX; Mat speckleY;
int *specklePointY; Mat speckleX;
long long *pus; Mat puss;
//int *specklePointX;
//int *specklePointY;
//long long *pus;
int previous_size; int previous_size;
//!method for setting the maximum disparity //!method for setting the maximum disparity
void setMaxDisparity(int val) void setMaxDisparity(int val)
...@@ -470,6 +473,9 @@ namespace cv ...@@ -470,6 +473,9 @@ namespace cv
CV_Assert(currentMap.cols == out.cols); CV_Assert(currentMap.cols == out.cols);
CV_Assert(currentMap.rows == out.rows); CV_Assert(currentMap.rows == out.rows);
CV_Assert(t >= 0); CV_Assert(t >= 0);
int *pus = (int *)puss.data;
int *specklePointX = (int *)speckleX.data;
int *specklePointY = (int *)speckleY.data;
memset(pus, 0, previous_size * sizeof(pus[0])); memset(pus, 0, previous_size * sizeof(pus[0]));
uint8_t *map = currentMap.data; uint8_t *map = currentMap.data;
uint8_t *outputMap = out.data; uint8_t *outputMap = out.data;
......
...@@ -328,9 +328,9 @@ namespace cv ...@@ -328,9 +328,9 @@ namespace cv
if(previous_size != width * height) if(previous_size != width * height)
{ {
previous_size = width * height; previous_size = width * height;
specklePointX = new int[width * height]; speckleX.create(height,width,CV_32SC4);
specklePointY = new int[width * height]; speckleY.create(height,width,CV_32SC4);
pus = new long long[width * height]; puss.create(height,width,CV_32SC4);
censusImage[0].create(left0.rows,left0.cols,CV_32SC4); censusImage[0].create(left0.rows,left0.cols,CV_32SC4);
censusImage[1].create(left0.rows,left0.cols,CV_32SC4); censusImage[1].create(left0.rows,left0.cols,CV_32SC4);
......
...@@ -697,9 +697,9 @@ namespace cv ...@@ -697,9 +697,9 @@ namespace cv
if(previous_size != width * height) if(previous_size != width * height)
{ {
previous_size = width * height; previous_size = width * height;
specklePointX = new int[width * height]; speckleX.create(height,width,CV_32SC4);
specklePointY = new int[width * height]; speckleY.create(height,width,CV_32SC4);
pus = new long long[width * height]; puss.create(height,width,CV_32SC4);
} }
double minVal; double maxVal; double minVal; double maxVal;
Mat imgDisparity8U2; Mat imgDisparity8U2;
......
...@@ -84,6 +84,9 @@ void CV_BlockMatchingTest::run(int ) ...@@ -84,6 +84,9 @@ void CV_BlockMatchingTest::run(int )
{ {
Mat image1, image2, gt; Mat image1, image2, gt;
//some test images can be found in the test data folder //some test images can be found in the test data folder
//in order for the tests to build succesfully please replace
//ts->get_data_path() + "testdata/imL2l.bmp with the path from your disk
//for example if your images are on D:\\ , please write D:\\testdata\\imL2l.bmp
image1 = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1); image1 = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1);
image2 = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1); image2 = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
gt = imread(ts->get_data_path() + "testdata/groundtruth.bmp", CV_8UC1); gt = imread(ts->get_data_path() + "testdata/groundtruth.bmp", CV_8UC1);
......
...@@ -115,7 +115,10 @@ CV_DescriptorBaseTest::~CV_DescriptorBaseTest() ...@@ -115,7 +115,10 @@ CV_DescriptorBaseTest::~CV_DescriptorBaseTest()
CV_DescriptorBaseTest::CV_DescriptorBaseTest() CV_DescriptorBaseTest::CV_DescriptorBaseTest()
{ {
//read 2 images from file //read 2 images from file
//two test images can be found in the test data folder //some test images can be found in the test data folder
//in order for the tests to build succesfully please replace
//ts->get_data_path() + "testdata/imL2l.bmp with the path from your disk
//for example if your images are on D:\\ , please write D:\\testdata\\imL2l.bmp
left = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1); left = imread(ts->get_data_path() + "testdata/imL2l.bmp", CV_8UC1);
right = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1); right = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment