Here's an image:
Can one, using the marching squares algorithm, write a program that given an input image like above, produces the following output:
Two chained line segments, one forming the above contours (hill-like), the other one forming the encapsuled circle contour?
If not, how else would you recommend doing it?