MATLAB: Removal Of objects from binary image.

eyefundusImage Processing Toolboxophthalmologyremoval of componentsretina

Hello, actually I am new to matlab and want to know how to remove some objects from a binary image based upon area. Such that when a particular threshold is set the components of image having area above threshold is removed. Like removing a large vessel of eye and not removing small ones. Is there any function??? Please provide assistance!

Best Answer

once you have got the binary image,you can do the following:
outputImage = xor(BW , bwareaopen(BW , threshArea));
% BW being the binary image
% it will discard objects with area greater then threshArea
imshow(outputImage)
Related Question