How to find boundaries of a blob such that they bound the image and not include it
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I have an image with adjacent blobs. I want the boundaries of these blobs such that the boundaries are outside the blob and contain the blob completely inside it. How can I do so?
bwboundaries gives the boundaries such that the it is on the edge of the blob and hence do not contain the blob completely inside it.
0 Commenti
Risposte (1)
Walter Roberson
il 29 Set 2017
Extract the blobs separately. For example,
labeled = bwlabel(YourImage);
for idx = 1 : numblob
thisbwimage = labeled == idx;
...
end
For each one, imdilate() with ones(3,3) and subtract the original from that, and then ask for the boundaries of that: the boundary should enclose the blob.
Note: this procedure will fail if the blob touches the outside edge, unless you pad the original with a sliver of black all the way around to prevent blobs from touching the edge.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!