Finding contours in vector of connected points
Hi!
I use a class called ConnectedComponents to split a binary image into vectors of connected points (Point2i).
I find it convenient to use these point vectors when sorting out which blob to use. But once I sort out the appropriate object, I need to perform stuff like circularity measurements. Thus the need for contours.
Is there an algorithm for finding the contour in a vector of points?
Would it be less taxing to convert the point vector to a mat, perform canny and then findContours?
EDIT
One way of doing it is:
- Threshold image
- Use a connected_components class to separate individual blobs
- Perform canny on the thresholded image
- Find the edges
- Map contours with the different sets of connected pixels
- Decide what
set set(s) of connectedcomponents we want - Find the contours associated with that set of connected pixels
What I would rather do is
- Threshold image
- Use a connectedcomponents class to store individual sets of connected pixels as points
- Decide what
set set(s) of connected pixels to use - Find the edges of that single set.