MATLAB: RegionProps

areaeccentricityimage segmentationregionprops

I want to select the pieces of an image that have these caracteristics: area > 10 and Eccentricity > 0,4.
How can i combine those in one fuction?
Thank you for the attention.
Daniel Carvalho

Best Answer

I = rand(100)>.75; %sample binary image
CC = bwconncomp(I); %Connected Components Analysis
stats = regionprops(CC,'area','eccentricity'); %regionprops
idx = [stats(:).Area]>10&[stats.Eccentricity]<0.4;
%logical indices corresponding to area > 10 and eccentricity <0.4.
Do what you what you want with CC,idx; all of the information is there.