From 7d8110772a44a1d8900e1ed81ec6abacd019d5af Mon Sep 17 00:00:00 2001 From: James Perkins Date: Thu, 5 Oct 2017 15:42:20 -0700 Subject: [PATCH] fix StereoBM disparity map right margin truncation when minDisparities > 0 --- modules/calib3d/src/stereosgbm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/calib3d/src/stereosgbm.cpp b/modules/calib3d/src/stereosgbm.cpp index 4c8adb9f9d..2358c31d8e 100644 --- a/modules/calib3d/src/stereosgbm.cpp +++ b/modules/calib3d/src/stereosgbm.cpp @@ -864,10 +864,10 @@ Rect getValidDisparityROI( Rect roi1, Rect roi2, int SADWindowSize ) { int SW2 = SADWindowSize/2; - int minD = minDisparity, maxD = minDisparity + numberOfDisparities - 1; + int maxD = minDisparity + numberOfDisparities - 1; int xmin = max(roi1.x, roi2.x + maxD) + SW2; - int xmax = min(roi1.x + roi1.width, roi2.x + roi2.width - minD) - SW2; + int xmax = min(roi1.x + roi1.width, roi2.x + roi2.width) - SW2; int ymin = max(roi1.y, roi2.y) + SW2; int ymax = min(roi1.y + roi1.height, roi2.y + roi2.height) - SW2;