使用侵蚀和扩张 [英] Working with erosion and dilatation

查看:161
本文介绍了使用侵蚀和扩张的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自上一个链接:

使用BoundingBox生成的特定区域

以下代码基于它

se = strel('disk',9);

p_mask=imerode(Ic(BB,1).Image,se);
k_mask=imdilate(p_mask,se);

Ipointer=I2.*repmat( k_mask , [1 1 3]);

figure,imshow(Ipointer)

Mch=Ic(BB,1).Image-k_mask;
Mbch=bwareaopen(Mch,3000);
Ichaplet=I2.*repmat( Mbch , [1 1 3]);
figure,imshow(Ichaplet)

所以,我不明白

推荐答案

谷歌是你的朋友。如果您不知道某个函数是做什么的,请使用Google Matlab +及其名称并阅读参考文档。

google is your friend. if you don't know what a function does, google matlab + its name and read the reference documentation.

se是您的结构元素。这里定义为半径为9
的磁盘 http:// de .mathworks.com / help / images / ref / strel-class.html

se is your structure element. Here defined as a disk with radius 9 http://de.mathworks.com/help/images/ref/strel-class.html

你的二进制图像被侵蚀,然后扩大(称为开放)
https://en.wikipedia.org/wiki/Opening_(morphology)

Your binary image is eroded, then dilated (which is called Opening) https://en.wikipedia.org/wiki/Opening_(morphology)

假设白色被认为是前景(我只能猜测没有你的图像)打开将删除小白点。侵蚀通过在轮廓周围啃咬来缩小一切。如果你吃了足够的东西就吃洞穴对象了:)扩张会调整那些没有被完全侵蚀的物体。膨胀会在轮廓周围添加像素。

Assuming white is considered foreground (I can only guess without your image) Opening will remove small white spots. Erosion shrink everything by nibbling around the contour. If you nibble enough you eat the hole object :) Dilation will resize those objects that have not been eroded completely. Dilation will add pixels around the contour.

bwareaopen将删除小于3000像素的连接组件
http://de.mathworks.com/help/images/ref/bwareaopen.html

bwareaopen will remove connected components smaller than 3000 pixels http://de.mathworks.com/help/images/ref/bwareaopen.html

我相信你可以自己弄清楚其余部分!

I'm sure you can figure out the rest on your own!

这篇关于使用侵蚀和扩张的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆