How to find indices of pixels outward from a detected boundary
Mostra commenti meno recenti
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 Commento
Risposte (2)
Image Analyst
il 20 Giu 2013
0 voti
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?
wond3rboy
il 21 Giu 2013
0 voti
Categorie
Scopri di più su Object Analysis in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
