MATLAB: How can you find circular blobs in an image

cannycirclesedge detectorImage Processing Toolbox

I am trying to find certain parts of an image, and so used the Canny edge detector. Now I want to get rid of all the edges that are not vaguely circular in shape. How can I remove them?
This is a sample image that I am trying to search.

Best Answer

What if the blob is shaped like a C or a G? Is that roughly circular? If so, you'll need to call bwconvhull() first. If not, you can look at the ration of perimeters square to areas
measurements = regionprops(binaryImage, 'Area', 'Perimeter');
allAreas = [measurements.Area];
allPerimeters = [measurements.Perimeter];
circularities = 4*pi*allAreas ./ allPerimeters^2;
round objects will have circularity values more than around 0.8 or so, or whatever value you want to go with.