-
结构元素的形状不一样,将会导致最终结果不一样,如果使用圆形结构元素,会导致区域 经过形态学处理后比较圆滑,如果使用矩形结构元素的话,经过形态学处理后就区域形状比较方正
-
打开一个窗口用于形态学操作的展示
read_image (Image, 'needle1')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
(一)腐蚀
1、定义
![](https://i-blog.csdnimg.cn/blog_migrate/a865e2e74bd29707ac63afb7c4abd87e.png)
![](https://i-blog.csdnimg.cn/blog_migrate/723b10f7e11ee83c2ca0329a368e3214.png)
![](https://i-blog.csdnimg.cn/blog_migrate/bd8e1569bc39d76bc286578fa7b968af.png)
结构元素的形状可以自定义
将结构元素在待处理区域上从上到下,从左到右的移动。如果结构元素与待处理区域完全相交,则保留锚点,其他位置像素被腐蚀
2、作用
-
把粘连的区域断开
-
减少像素
3、算子
-
erosion_circle、erosion_rectangle1 、erosion1
4、程序源码
*以圆形结构元素进行腐蚀
read_image (Image, 'pellets')
binary_threshold (Image, LightRegion, 'max_separability', 'light', UsedThreshold)
erosion_circle (LightRegion, RegionErosion1, 7.5)
dev_di