From 5efd2056f027fdab3b767eb5c1297d2d8271cbff Mon Sep 17 00:00:00 2001 From: Thierry Hoinville Date: Tue, 6 May 2014 15:33:07 +0200 Subject: [PATCH 1/2] Bugfix #3668 in FilterEngine::apply(), use the ROI properly --- modules/imgproc/src/filter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/filter.cpp b/modules/imgproc/src/filter.cpp index 1d05d3c2c..a55c1b0c6 100644 --- a/modules/imgproc/src/filter.cpp +++ b/modules/imgproc/src/filter.cpp @@ -453,8 +453,12 @@ void FilterEngine::apply(const Mat& src, Mat& dst, dstOfs.y + srcRoi.height <= dst.rows ); int y = start(src, srcRoi, isolated); - proceed( src.data + y*src.step, (int)src.step, endY - startY, - dst.data + dstOfs.y*dst.step + dstOfs.x*dst.elemSize(), (int)dst.step ); + proceed( src.data + y*src.step + + srcRoi.x*src.elemSize(),/* Bugfix #3668 use the x-shift of ROI + */ + (int)src.step, endY - startY, + dst.data + dstOfs.y*dst.step + + dstOfs.x*dst.elemSize(), (int)dst.step ); } } From e50ef2dab596935f9ed75389ca4acd2f3dbfc77e Mon Sep 17 00:00:00 2001 From: thoinvil Date: Wed, 7 May 2014 18:27:08 +0200 Subject: [PATCH 2/2] Bugfix #3668 removed the comment --- modules/imgproc/src/filter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/imgproc/src/filter.cpp b/modules/imgproc/src/filter.cpp index a55c1b0c6..6cdcf3cfb 100644 --- a/modules/imgproc/src/filter.cpp +++ b/modules/imgproc/src/filter.cpp @@ -454,8 +454,7 @@ void FilterEngine::apply(const Mat& src, Mat& dst, int y = start(src, srcRoi, isolated); proceed( src.data + y*src.step - + srcRoi.x*src.elemSize(),/* Bugfix #3668 use the x-shift of ROI - */ + + srcRoi.x*src.elemSize(), (int)src.step, endY - startY, dst.data + dstOfs.y*dst.step + dstOfs.x*dst.elemSize(), (int)dst.step );