Edge detection and image segmentation: two sides of the same coin