Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
My project is to get the skeleton of image ,I used the method of thinning that is to remove all simple points of the contour.
I have a problem with obtaining all contours of image,i'm only getting the first contour.

is there a function that returns all the contours of an image???

I programe with opencv2.2 C++.
Waiting for your reply.
Thank you.
Posted
Updated 11-Apr-14 11:57am
v2

1 solution

Did you try this code?

C++
vector<vector<Point>> contours;
    vector<Vec4i> hierarchy;
    findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900