2016-01-08 02:22:15 -0600 | received badge | ● Nice Question (source) |
2013-03-27 07:41:11 -0600 | received badge | ● Student (source) |
2013-03-26 12:24:01 -0600 | asked a question | Bug in findContours or convexHull or convexityDefects I think I found a bug but I don't know what assumptions are suppose to be true for the functions findContours, convexHull, and convexityDefects. I have a contour around an image that may have a little noise because of the segmentation previous to finding contours. Some points in the contour exists multiple times (not right next to each other but with one Point in between them). I assume that is valid and when I draw the contour it looks great. Where I think the real problem is is in convexHull. I'm calling it using So I expect to get back a list of indices into the contour. In cvConvexityDefects it checks the orientation of the hull points by looking at the first 3 indices of the hull. So it assumes that all the indices in the hull points should be decreasing or increasing. Is that correct? I get the following list of indices as hull points with the problem bolded. Indices are decreasing until it gets to that point. This causes convexityDefects to check all the points on the contour rather than the points between the two hull points and give a bad result.
|