[Solved] Returning specific regions [closed]


You can group the results of regionprops into a vector and use it for indexing:

rg = regionprops( L, 'Area' );
allArea = [rg(:).Area]; % grouping all area values into a single vecotr
labels = find( allArea >= 300 & allArea < 500); % select relevant regions

solved Returning specific regions [closed]