From 7dc673fd56aa753e870d7e0d3b3f6236e215cba0 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 25 Nov 2016 18:19:43 +0300 Subject: [PATCH] imgproc: fix findContours (submatrix input) --- modules/imgproc/src/contours.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgproc/src/contours.cpp b/modules/imgproc/src/contours.cpp index 0adc01b1a7..baa27c4ac3 100644 --- a/modules/imgproc/src/contours.cpp +++ b/modules/imgproc/src/contours.cpp @@ -1904,7 +1904,7 @@ void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours, CV_Assert(_contours.empty() || (_contours.channels() == 2 && _contours.depth() == CV_32S)); Mat image; - copyMakeBorder(_image, image, 1, 1, 1, 1, BORDER_CONSTANT, Scalar(0)); + copyMakeBorder(_image, image, 1, 1, 1, 1, BORDER_CONSTANT | BORDER_ISOLATED, Scalar(0)); MemStorage storage(cvCreateMemStorage()); CvMat _cimage = image; CvSeq* _ccontours = 0;