How to check which cluster (connected component) a point belongs to in a binary image?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ramin bba
le 15 Déc 2014
Réponse apportée : Image Analyst
le 15 Déc 2014
I have a binary image that has some clusters in it. I also have a code ( http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial---blobsdemo-- ) that allows me to find the connected objects in it. Here is my question:
Given a set of points, how can I efficiently find which cluster (connected component) each point belongs to?
Thanks,
Ramin
0 commentaires
Réponse acceptée
Image Analyst
le 15 Déc 2014
Let's say you have some row and column coordinate/location that you're interested in finding out which blob (labeled component) that point belongs to. It's very easy - it's just the labeled image value at that point.
row = 42; % Whatever....
col = 123; % Whatever...
labeledImage = bwlabel(binaryImage);
blobNumber = labeledImage(row, column);
0 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!