I know the edge detection problem has been posted before (in Java: Count the number of objects in an Image, language independent: Image edge detection), but I want to know how t
There is a very simple way to find contours in python with scikit image. It's really just a couple line of code, like this:
from skimage import measure
contours = measure.find_contours(gimg, 0.8)
This returns the vector representation of the contour lines. In a separate array for each line. And it's also easy to decrease the number of points in a line by calculating an approximation. Here is a bit longer description with source code: image vectorization with python