简体   繁体   中英

Finding convexhull in an image using opencv and c++?

i am new to opencv and i was following the tutorials that are posted in docs.opencv.org. I was checking out this program which explained how to find the convex hull in an image. I couldnot understand this very part of the program.

vector > contours;

vector hierarchy;

what does these two lines mean?

Thanks,

In the Documentation of findContours you should find all the information you are looking for. Basically, contours is a vector of the contours each of which is a vector of points (you can define a policy which points should be retrieved from the contour: all points or only corner points etc.) with the 'method' parameter. hierarchy is a vector containing 4 indices for each contour, the index of the next and previous contours on the same level, the first child and the parent respectively. There's also a 'mode' parameter that defines the behavior of the contour detection with nested contours. I hope this helps.

Edit: Btw, you should always link the souce you are referring to, I assume it is this tutorial ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM