bwconncomp, use the ids assigned by Matlab in a image.
Afficher commentaires plus anciens
Hi, when I use bwconncomp function, this create a cc 1x1 struct
Connectivity 8 ImageSize [145 145] NumObjects 7 PixelIdxList 1x7 cell
is there a way to get the numobjects value using a function to can use this one to create others functions or tasks?
Réponse acceptée
Plus de réponses (1)
Mani
le 22 Août 2012
0 votes
use numPixels = cellfun(@numel,CC.PixelIdxList); objects=length(numPixels);
hope that answers
1 commentaire
Image Analyst
le 22 Août 2012
Or you could just ask for the Area when you call regionprops (which you've already had to have had called if you had PixelIdxList)
Catégories
En savoir plus sur Region and Image Properties dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!