RegionProps
Show older comments
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
1 Comment
John Wick
on 6 Jul 2023
I = imread('cell.tif'); [~,threshold] = edge(I,'sobel'); fudgeFactor = 0.5; BWs = edge(I,'sobel',threshold * fudgeFactor); se90 = strel('line',3,90); se0 = strel('line',3,0); BWsdil = imdilate(BWs,[se90 se0]); BWdfill = imfill(BWsdil,'holes'); BWnobord = imclearborder(BWdfill,4); seD = strel('diamond',1); BWfinal = imerode(BWnobord,seD); BWfinal = imerode(BWfinal,seD); subplot(3, 3, 1), imshow(I),title('Orginal image'); subplot(3, 3, 2), imshow(BWs),title('Binary Gradient Mask'); subplot(3, 3, 3), imshow(BWsdil),title('Dilated Gradient Mask'); subplot(3, 3, 4), imshow(BWdfill),title('BI with Filled Holes'); subplot(3, 3, 5), imshow(BWnobord),title('Cleared Border Image'); subplot(3, 3, 6), imshow(BWfinal),title('Segmented Image'); subplot(3, 3, 7), imshow(labeloverlay(I,BWfinal)),title('Mask Over Image');
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!