Skip to content

Commit 707beb3

Browse files
committed
modified matching class such that parameters are added at runtime
Removed the matching cpp file as it is no longer usefull removed warnings header for some used functions fixed the popcnt issue changes according to comments
1 parent df85952 commit 707beb3

File tree

4 files changed

+303
-391
lines changed

4 files changed

+303
-391
lines changed

modules/stereo/include/opencv2/stereo.hpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ namespace cv
147147
virtual int getSmallerBlockSize() const = 0;
148148
virtual void setSmallerBlockSize(int blockSize) = 0;
149149

150-
virtual Rect getROI1() const = 0;
151-
virtual void setROI1(Rect roi1) = 0;
152-
153-
virtual Rect getROI2() const = 0;
154-
virtual void setROI2(Rect roi2) = 0;
155-
156150
virtual int getScalleFactor() const = 0 ;
157151
virtual void setScalleFactor(int factor) = 0;
158152

@@ -233,9 +227,9 @@ namespace cv
233227
zero. In the current implementation, this parameter must be divisible by 16.
234228
@param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
235229
somewhere in the 3..11 range.
236-
@param P1 The first parameter controlling the disparity smoothness. See below.
237-
@param P2 The second parameter controlling the disparity smoothness. The larger the values are,
238-
the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
230+
@param P1 The first parameter controlling the disparity smoothness.This parameter is used for the case of slanted surfaces (not fronto parallel).
231+
@param P2 The second parameter controlling the disparity smoothness.This parameter is used for "solving" the depth discontinuities problem.
232+
The larger the values are, the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
239233
between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
240234
pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
241235
P1 and P2 values are shown (like 8\*number_of_image_channels\*SADWindowSize\*SADWindowSize and
@@ -263,7 +257,7 @@ namespace cv
263257
to a custom value.
264258
*/
265259
CV_EXPORTS static Ptr<cv::stereo::StereoBinarySGBM> create(int minDisparity, int numDisparities, int blockSize,
266-
int P1 = 0, int P2 = 0, int disp12MaxDiff = 0,
260+
int P1 = 100, int P2 = 1000, int disp12MaxDiff = 0,
267261
int preFilterCap = 0, int uniquenessRatio = 0,
268262
int speckleWindowSize = 0, int speckleRange = 0,
269263
int mode = StereoBinarySGBM::MODE_SGBM);

modules/stereo/src/matching.cpp

Lines changed: 0 additions & 338 deletions
This file was deleted.

0 commit comments

Comments
 (0)