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.

enter image description here

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:

enter image description here

so, has 6 elements each corresponding 1 contour. let's take contours[0] example. looks like:

enter image description here

contours[0] has 5 elements, each of stores coordinates of pixels form contour.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -