find endpoint coordinates(x,y) of connected components using pixelidxlist

2 vues (au cours des 30 derniers jours)
sufian ahmed
sufian ahmed le 10 Juin 2017
Commenté : Walter Roberson le 11 Juin 2017
raw_image:
*
*
CC = bwconncomp(zz_out);
numPixels = cellfun(@numel,CC.PixelIdxList);
figure, imshow(zz_out);
[smallest,idx] = min(numPixels);
zz_out(CC.PixelIdxList{idx}) = 0;
  • I have an image which has some concurrent connected components, say as: line segments.Now i want to extract all the endpoint's coordinates(x,y) of those lines using pixelidlist.*

Réponses (1)

Walter Roberson
Walter Roberson le 11 Juin 2017
bwmorph() and ask for 'endpoints'
  3 commentaires
sufian ahmed
sufian ahmed le 11 Juin 2017
Modifié(e) : sufian ahmed le 11 Juin 2017
can u provide me the demo code please, Thanks :)
Walter Roberson
Walter Roberson le 11 Juin 2017
[L, Num] = bwlabel(zz_out);
for K = 1 : Num
[epr{K}, epc{K}] = find( bwmorph(L == K, 'endpoints') );
end
Now epr{K} is the list of row indices of all of the endpoints of component #K, and epc{K} is the corresponding list of column indices. Any component that is not an isolated pixel should have at least two endpoints, and could have more if there are branches in it. (Note, though: I do not know how endpoint detection works if there are loops in the component.)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by