Convex hull lastmod 2023-01-12 created 2022-07-12 8 edits
The set formed by connecting the outermost points among a number of points. All points must lie inside the Convex Hull region, and no points may lie outside it.
General procedure It is usually used in the following order.
Turn the original image into a binary image using cv2.threshold Extract the image contours using cv2.findContours Connect the outermost lines using cv2.convexHull . (If needed) draw it with cv2.drawContours . hull = cv2 . convexHull ( cnt )
cv2 . drawContours ( img1 , [ hull ], 0 , ( 0 , 255 , 0 ), 3 )
Cv2_convexHull_sample.png
See also Favorite site Algorithm : ConvexHull (Graham's Scan) Function: Detecting the outermost contour with Convex Hull Beginner's guide to understand Fingertips counting using convexity defects in OpenCV Beginner's guide to understand Fingertips counting using convexity defects in OpenCV Fingertip Detection in OpenCV Learn OpenCV by Examples: Convex Hull Lecture 3: More Convex Hull Algorithms Crocus - Convex Hull Algorithm - Algorithm explanation and implementation from scratch Pages that link here