Ask Your Question

Revision history [back]

see documentation

Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as binary

be sure you binarized your image

see documentation

Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as binary

be sure you binarized your image

Mat test = imread("test.png", 0);
Mat test1 = imread("test.png", 0);
blur(test, test,Size(19,19));
test = test / 50;

std::vector<std::vector<Point> > contours;

findContours(test, contours, RETR_TREE, CHAIN_APPROX_SIMPLE);

drawContours(test, contours, -1, Scalar(255), 1);

imshow("test", test+test1);

image description

image description