How can i know the location of blobs/contour
I had tried few methods to get the location of the contour or blobs from a moving image. Yet still could not achieve. Below are the images. I had tried using contour hierarchy but the numbering of the hierarchy does not consistent as I'm using area size and perimeter to distinguish the blobs location. Still not successful.
The only thing that i want to know is whether the smaller blobs position is at the top of the bigger blobs or at the bottom of the bigger blobs as in image 3. Anyone can help?
" I had tried using contour hierarchy" -- there is no hierarchy here.
maybe, minAreaRect , and do something with those coords ?
hi Berak,
what i meant for hierarchy is this one. But maybe I'm wrong.
void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())
Parameters: hierarchy – Optional output vector, containing information about the image topology. It has as many elements as the number of contours. For each i-th contour contours[i] , the elements hierarchy[i][0] , hiearchy[i][1] , hiearchy[i][2] , and hiearchy[i][3] are set to 0-based indices in contours of the next and previous contours at the same hierarchical level, the first child contour and the parent contour, respectively. If for the contour i there are no next, previous, parent, or nested contours, the corresponding elements of hierarchy[i] will be negatve
"nested contours" -- that's the keyword, here. your images don't have any of that
think of an "O", there's an outer ring and and an inner one, again not at all your problem here.