Skip to content

Commit 2cfe292

Browse files
committed
fix StereoBM disparity map right margin truncation when minDisparities > 0
1 parent 92a0808 commit 2cfe292

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/calib3d/src/stereosgbm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,10 +2273,10 @@ Rect getValidDisparityROI( Rect roi1, Rect roi2,
22732273
int SADWindowSize )
22742274
{
22752275
int SW2 = SADWindowSize/2;
2276-
int minD = minDisparity, maxD = minDisparity + numberOfDisparities - 1;
2276+
int maxD = minDisparity + numberOfDisparities - 1;
22772277

22782278
int xmin = std::max(roi1.x, roi2.x + maxD) + SW2;
2279-
int xmax = std::min(roi1.x + roi1.width, roi2.x + roi2.width - minD) - SW2;
2279+
int xmax = std::min(roi1.x + roi1.width, roi2.x + roi2.width) - SW2;
22802280
int ymin = std::max(roi1.y, roi2.y) + SW2;
22812281
int ymax = std::min(roi1.y + roi1.height, roi2.y + roi2.height) - SW2;
22822282

0 commit comments

Comments
 (0)