How to find indices of pixels outward from a detected boundary
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I am working on an application in which I am required to find the pixel value indices extruding out from the largest region. I have found the boundary of the region but can't of way to ensure that pixels are always looked for outwards from the boundary. I would be thankful if you guys could contribute on the matter.
a=logical([0 0 0 0 1;0 1 1 0 0;0 0 1 1 0;0 1 1 1 0; 0 0 1 1 0;1 0 0 0 0]); %Test matrix
acon=regionprops(a,'Area','PixelIdxList'); %finds the connected components
loca=find([acon.Area]==max([acon.Area])); %Pixel seq index of largest comp
%in detected regions
abound=bwboundaries(a,8,'noholes'); %Finds location of boundary of region
dom_bound=abound{loca}; %Get locations of boundary pixels
1 commentaire
Réponses (2)
Image Analyst
le 20 Juin 2013
Not exactly sure what you want. But once you've extracted the largest blob (I've posted code for that here before), then you can call imdilate() to enlarge that blob by one layer of pixels, and then call bwboundaries(). Is that what you meant?
0 commentaires
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
