How to create approximate contours?
We can create approximate contours by
cv2.approxPolyDP(curve, epsilon, closed) where
- curve : a individual contour we wish to approximate
- epsilon : Important parameter is determining the accuracy of the approximation. Small values give precise- approximations, large values give more generic approximation.
We can get epsilon by
small number * cv2.arcLength(curve, closed) - closed : a Boolean value that states whether the approximate contour should be open or closed.
Result
What is Convex Hull?
convex curves are the curves which are always bulged out, or at-least flat. And if it is bulged inside, it is called convexity defects. We can get Convex Hull as: cv2.convexHull(points) where
- points : a individual contour.