imgproc: fix findContours (submatrix input)
authorAlexander Alekhin <alexander.alekhin@intel.com>
Fri, 25 Nov 2016 15:19:43 +0000 (18:19 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Fri, 25 Nov 2016 15:25:26 +0000 (18:25 +0300)
modules/imgproc/src/contours.cpp

index 0adc01b..baa27c4 100644 (file)
@@ -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;