In a multi-connection or an internal modification of any two edge points are included in a polygon edge or the inside.
Minimum convex point set S containing all points in the convex hull polygon is called
Convex hull scanning detection algorithm --Graham
2. Graham scan algorithm
First, choose the lowest point in the Y direction as a starting point p0
From the polar coordinates p0 start scanning sequentially adding p1 ... .pn (sort order based on the size of the polar angle, counterclockwise direction)
For each point pi, pi is added if the convex hull points to cause a left turn (counterclockwise method) is added to the convex hull points, whereas if a right turn leads (clockwise) to remove the point from the convex hull in
3. Step
First, the image from RGB to gray
And then converted to a binary image
Then obtained by finding the contour candidate point