Methods of Detecting and Removing Protrusions in Image
Mostra commenti meno recenti
Is there any way to remove only the red shaded area of an image like the one below?
The data is a binary image and is binarized.
The image we are recognizing is basically a figure like the one on the left, so we can use bwareafilt to extract the maximum structure.
However, sometimes we get images like the one on the right. It does not mean that every time they are attached.
It would be best if we could set a threshold (if they are too close together, we recognize them as one), since the degree of attachment of the two objects varies.
We would appreciate it if you could let us know.

5 Commenti
John D'Errico
il 13 Ago 2024
Why not start with an erosion operation, to narrow any thin necks to the point where the two objects are no longer connected?
HanaHana
il 13 Ago 2024
Regarding removal by morphological operations, see imopen(), which is an erosion followed by a dilation.
See also:
A concrete example could be made if you provide an example image.
HanaHana
il 15 Ago 2024
Catalytic
il 15 Ago 2024
What I want to recognize is "approximately" an oval shape, so I want to remove the part that extends outside of the oval shape.
There is no unique oval shape that fits your images. You need a more well-defined criterion.
Risposta accettata
Più risposte (2)
Image Analyst
il 14 Ago 2024
Yes, you just call imerode to eat away enough layers such that the blob separates into two blobs. Then you "thicken" the image with bwmorph which will restore the two blobs to their original size but not let them merge. Then call bwareafilt to select the largest blob. Something like this (untested)
se = strel('disk', 5, 0); % Create structuring element. Change the 5 as necessary.
mask = imerode(mask, se); % Erode the image to separate the blobs.
mask = bwmorph(mask, 'thicken', inf); % Regrow without merging.
mask = bwareafilt(mask, 1); % Take largest blob only.
1 Commento
HanaHana
il 15 Ago 2024
Categorie
Scopri di più su Image Processing Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



