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
You can easily achieve edge detection with scipy in python.
from scipy import ndimage
edge_horizont = ndimage.sobel(greyscale, 0)
edge_vertical = ndimage.sobel(greyscale, 1)
magnitude = np.hypot(edge_horizont, edge_vertical)
And here is an example of original image and the image after edge detection.
In scikit-image, there is a special page with explanations of how to do edge detection.