I think you're better off not using an edge detector and simply doing thresholding. Call imopen() afterwards to delete the lines between the shapes.
binaryImage = grayImage < 128;
binaryImage = imopen(binaryImage, true(3));
measurements = regionprops(binaryImage, 'BoundingBox');
This is easier and better. Edge detectors often give two edges - a positive one and a negative one on each side of the "true" edge.
See code in my Image Segmentation Tutorial to see how to crop the bounding box out of the image into separate images. BlobsDemo Image Segmentation Tutorial
