フィルターのクリア

Is there a way to inverse image dilation?

5 ビュー (過去 30 日間)
jupiter
jupiter 2016 年 11 月 4 日
回答済み: Image Analyst 2020 年 5 月 9 日
I have an image in which my requirement is to select two pixels away from the boundary, but inside. For selecting n number of pixels outside, I can do it by 'imdilate' function. Is there a way to select pixels inside the boundary either using 'imdilate' or 'imerode' or some other functions?

回答 (2 件)

Asieh Daneshi
Asieh Daneshi 2020 年 5 月 9 日
Hi Jupiter,
I think you have found the answer of your question by yourself. But I leave the answer to others who may have the same question. "imerde" does what you want.

Image Analyst
Image Analyst 2020 年 5 月 9 日
One way is to use bwdist() and then threshold at 2.
edtImage = bwdist(mask);
imshow(edtImage, []);
mask = edtImage >= 2;
imshow(mask);

Community Treasure Hunt

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

Start Hunting!

Translated by