connected components (or just regionprops) on integer image

3 Ansichten (letzte 30 Tage)
Michael Alonzo
Michael Alonzo am 13 Apr. 2018
Beantwortet: Matt J am 13 Apr. 2018
Hi all --
I am attempting to segment an image and then gather statistics (regionprops) on each image object. I have completed the segmentation and there are 110 unique values that are mostly (but not entirely) grouped spatially. My question is: How do I conduct a connected components analysis on this non-binary output? I'd like to avoid running watershed on this because it seems unnecessary to introduce the 0-value borders (thus reducing image information content). Any suggestions?
Thanks, Mike

Antworten (1)

Matt J
Matt J am 13 Apr. 2018
I would do something like this,
vals=unique(yourImage(:));
fun = @(v) regionprops(yourImage==v,...);
stats = cell2mat( arrayfun( fun , vals, 'uni',0) );

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by