1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

fix StereoBM disparity map right margin truncation when minDisparities > 0

This commit is contained in:
James Perkins
2017-10-05 15:42:20 -07:00
committed by James Perkins
parent 92a0808379
commit 2cfe29276e
+2 -2
View File
@@ -2273,10 +2273,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 = std::max(roi1.x, roi2.x + maxD) + SW2;
int xmax = std::min(roi1.x + roi1.width, roi2.x + roi2.width - minD) - SW2;
int xmax = std::min(roi1.x + roi1.width, roi2.x + roi2.width) - SW2;
int ymin = std::max(roi1.y, roi2.y) + SW2;
int ymax = std::min(roi1.y + roi1.height, roi2.y + roi2.height) - SW2;