changed the speckle vectors to mats and added comments

pull/326/head
Muresan Mircea Paul 10 years ago
parent a102eeb1e7
commit e7ab49ebb3
  1. 12
      modules/stereo/src/matching.hpp
  2. 6
      modules/stereo/src/stereo_binary_bm.cpp
  3. 6
      modules/stereo/src/stereo_binary_sgbm.cpp
  4. 3
      modules/stereo/test/test_block_matching.cpp
  5. 5
      modules/stereo/test/test_descriptors.cpp

@ -359,9 +359,12 @@ namespace cv
};
protected:
//arrays used in the region removal
int *specklePointX;
int *specklePointY;
long long *pus;
Mat speckleY;
Mat speckleX;
Mat puss;
//int *specklePointX;
//int *specklePointY;
//long long *pus;
int previous_size;
//!method for setting the maximum disparity
void setMaxDisparity(int val)
@ -470,6 +473,9 @@ namespace cv
CV_Assert(currentMap.cols == out.cols);
CV_Assert(currentMap.rows == out.rows);
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]));
uint8_t *map = currentMap.data;
uint8_t *outputMap = out.data;

@ -328,9 +328,9 @@ namespace cv
if(previous_size != width * height)
{
previous_size = width * height;
specklePointX = new int[width * height];
specklePointY = new int[width * height];
pus = new long long[width * height];
speckleX.create(height,width,CV_32SC4);
speckleY.create(height,width,CV_32SC4);
puss.create(height,width,CV_32SC4);
censusImage[0].create(left0.rows,left0.cols,CV_32SC4);
censusImage[1].create(left0.rows,left0.cols,CV_32SC4);

@ -697,9 +697,9 @@ namespace cv
if(previous_size != width * height)
{
previous_size = width * height;
specklePointX = new int[width * height];
specklePointY = new int[width * height];
pus = new long long[width * height];
speckleX.create(height,width,CV_32SC4);
speckleY.create(height,width,CV_32SC4);
puss.create(height,width,CV_32SC4);
}
double minVal; double maxVal;
Mat imgDisparity8U2;

@ -84,6 +84,9 @@ void CV_BlockMatchingTest::run(int )
{
Mat image1, image2, gt;
//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);
image2 = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);
gt = imread(ts->get_data_path() + "testdata/groundtruth.bmp", CV_8UC1);

@ -115,7 +115,10 @@ CV_DescriptorBaseTest::~CV_DescriptorBaseTest()
CV_DescriptorBaseTest::CV_DescriptorBaseTest()
{
//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);
right = imread(ts->get_data_path() + "testdata/imL2.bmp", CV_8UC1);

Loading…
Cancel
Save