Ask Your Question

Revision history [back]

the problem is about cv::Canny

if we use threshold like

cannyOut = srcGray < 127;

then we get this result

image description

Mat cannyOut;
Canny(srcGray, cannyOut, otsu, otsu * 1 / 2, 3, 1);
//******************//
// added this line
cannyOut = srcGray < 127; 
// Find contours
vector<vector<Point> > contours;

as explained on similar question the problem is about cv::Canny

if we use threshold like

cannyOut = srcGray < 127;

then we get this result

image description

Mat cannyOut;
Canny(srcGray, cannyOut, otsu, otsu * 1 / 2, 3, 1);
//******************//
// added this line
cannyOut = srcGray < 127; 
// Find contours
vector<vector<Point> > contours;