I have a binary image with multiple blobs. I want to find the number of pixels in each blob. My version of openCV is below 3.0, so I don't have connectedComponents function. I was trying findContourinstead. If the image is im, I execute findContour as:
cv::findContours(im.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
Now, size of contour[i] or contourArea(contours[i]); don't really give the number of pixels. Is there any other function to find the number of pixels in each blob?
A post recommends cvBlobslib library but is there an inbuilt function in OpenCV (version lower than 3.0)?