Abstract
You can use this algorithm to get contours from an image.
It also turns clockwise or counterclockwise depending on whether it is facing inward or outward, which is convenient when draw it.
How it works.
We can find the contour by connecting around the sides of Marching Square.
I recommend you to watch this video to learn Marching Square.
www.youtube.com
Download
Iadded it to the Marching Square repository with the name Polygon_from_Raster_with_Marching_Square.
github.com