Contours of height 1 and moment
Hi,
I have got this program
Mat grayscaleImage;
Mat imgOrig = imread("BLOB_MSER.bmp", IMREAD_UNCHANGED)
cvtColor(imgOrig, grayscaleImage, COLOR_BGR2GRAY);
Mat binarizedImage;
threshold(grayscaleImage, binarizedImage, 20, 255, THRESH_BINARY);
std::vector < std::vector<Point> > contours;
Mat tmpBinaryImage = binarizedImage.clone();
findContours(tmpBinaryImage, contours, RETR_LIST, CHAIN_APPROX_NONE);
Moments moms = moments(Mat(contours[20]));
For contours[20] I have got 1076 points but all moments are 0. What's wrong? When I call SimpleBlobDetector with this image I have got an exception for this contour
data are here
Thanks for your help
Did you try using cv::drawContours to draw this specific contour?
No In debugging I can see that all y-coordinate points are 1(y=1)
There seems to be a border on top and left sides of the image, maybe that's causing the problem.
May be you can test program and see if you've got same result as me. It would be helpfull