From dd576c89a3f2e5f7dbf7945813a4fd5ed056bfd3 Mon Sep 17 00:00:00 2001 From: Paolo Perkovic Date: Sat, 1 Apr 2017 13:29:44 +0200 Subject: [PATCH] Fix StereoBM ROI selection - Fix StereoBM ROI (Region of interest) selection for stereo images used by block matching algorithm --- modules/calib3d/src/stereobm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/calib3d/src/stereobm.cpp b/modules/calib3d/src/stereobm.cpp index eb075d8c73..5ed45a4884 100644 --- a/modules/calib3d/src/stereobm.cpp +++ b/modules/calib3d/src/stereobm.cpp @@ -1184,8 +1184,8 @@ public: parallel_for_(Range(0, 2), PrefilterInvoker(left0, right0, left, right, _buf, _buf + bufSize1, ¶ms), 1); Rect validDisparityRect(0, 0, width, height), R1 = params.roi1, R2 = params.roi2; - validDisparityRect = getValidDisparityROI(R1.area() > 0 ? Rect(0, 0, width, height) : validDisparityRect, - R2.area() > 0 ? Rect(0, 0, width, height) : validDisparityRect, + validDisparityRect = getValidDisparityROI(R1.area() > 0 ? R1 : validDisparityRect, + R2.area() > 0 ? R2 : validDisparityRect, params.minDisparity, params.numDisparities, params.SADWindowSize);