What is meant by imdilate?

12 次查看(过去 30 天)
Hi, can i know what is meant by:
(imdilate(L == 0, ones(3,3))
What is L == 0?
and ones(3,3)
This can be found in marker controlled watershed segmentation algorithm.
Thank you very much.
gradmag2 = imimposemin(gradmag, bgm | fgm4);
L = watershed(gradmag2);
I4 = I;
I4(imdilate(L == 0, ones(3, 3)) | bgm | fgm4) = 255;
figure, imshow(I4), title('Markers and object boundaries superimposed on original image (I4)');
  1 个评论
Ive J
Ive J 2021-1-16
If you are not familiar with MATLAB basics, please take a look at:
https://se.mathworks.com/help/matlab/getting-started-with-matlab.html

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2021-1-16
L is a labeled image. A label of 0 means an unlabeled region, usually the background, though I'm not sure the labeled image coming from a watershed would have any background.
It sets I4 to the original image and then
So then it dilates (expands) the background region. Then it takes any true values in the other binary imagesbgm and fgm4 and combines them to form a mask of all three images ORed together. Any pixels in the I4 image that are where the combined mask are white will also be set to white.
So basically it takes a bunch of regions and sets a gray scale image to white in those regions.

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by