Skip to content

Commit 7d81107

Browse files
committed
fix StereoBM disparity map right margin truncation when minDisparities > 0
1 parent fb4c2ba commit 7d81107

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
@@ -864,10 +864,10 @@ Rect getValidDisparityROI( Rect roi1, Rect roi2,
864864
int SADWindowSize )
865865
{
866866
int SW2 = SADWindowSize/2;
867-
int minD = minDisparity, maxD = minDisparity + numberOfDisparities - 1;
867+
int maxD = minDisparity + numberOfDisparities - 1;
868868

869869
int xmin = max(roi1.x, roi2.x + maxD) + SW2;
870-
int xmax = min(roi1.x + roi1.width, roi2.x + roi2.width - minD) - SW2;
870+
int xmax = min(roi1.x + roi1.width, roi2.x + roi2.width) - SW2;
871871
int ymin = max(roi1.y, roi2.y) + SW2;
872872
int ymax = min(roi1.y + roi1.height, roi2.y + roi2.height) - SW2;
873873

0 commit comments

Comments
 (0)