how to read data stored in output of findcontour function in opencv using c++ -
i want label objects in binary image using find contour , drawcontour function.
i want know data stored in output array of findcontour function.
further, there other suitable methods above?
@berak's comment answered already. i'll add part of how output like. consider 35x62 image 5 times enlarged version below. image has 6 blobs or objects each of has corresponding contour.
the above image stored in mat object im
. findcontour
applied as
cv::findcontours(im.clone(), contours, cv_retr_external, cv_chain_approx_none);
the output of findcontour vector<vector<point>>
object contours
looks like:
so, has 6 elements each corresponding 1 contour. let's take contours[0]
example. looks like:
contours[0]
has 5 elements, each of stores coordinates of pixels form contour.
Comments
Post a Comment