I have a binary image 'i' which I have attached here. From this image, I want to find the two biggest blobs in terms of area. When I tried this code, I am able to find the biggest blob which I have attached and the next biggest blob is removed.
labeledImage=bwlabel(i);measurements=regionprops(labeledImage,'Area');allAreas=[measurements.Area];[biggestArea, indexOfBiggest]=sort(allAreas,'descend')biggestBlob=ismember(labeledImage,indexOfBiggest(1));biggestBlob=biggestBlob>0;figure,imshow(biggestBlob,[]);
I tried to use the bwareafilt() but MATLAB R2013a does not support it. Kindly help me to display the next biggest blob.
Thanking you.
Best Answer