形态学膨胀腐蚀开闭运算

*开运算:先对区域进行腐蚀操作,然后再进行膨胀操作
*开运算特点:防止腐蚀过度,能够很好的保持区域的形状
Opening_circle()
Opening_rectangle1()
*闭运算:先对区域进行膨胀操作,然后再进行腐蚀操作
*闭运算特点:防止膨胀过度能够很好的保持区域形状
closing_circle()
closing_rectangle1 ()
*灰度图像的开闭运算:
开:gray_opening_rect()
闭:gray_closing_rect()

例:

read_image (Image, ‘printer_chip/printer_chip_01’)
threshold (Image, Region, 128, 255)
connection (Region, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, ‘area’, ‘and’, 20500, 99999)
*矩形结构元素膨胀
dilation_rectangle1 (SelectedRegions, RegionDilation, 11, 11)
*圆形结构元素膨胀
dilation_circle (RegionDilation, RegionDilation1, 3.5)
*矩形结构元素腐蚀
erosion_rectangle1 (RegionDilation1, RegionErosion, 11, 11)
*圆形结构元素腐蚀
erosion_circle (RegionErosion, RegionErosion1, 3.5)
*矩形结构元素开运算
opening_rectangle1 (RegionErosion1, RegionOpening, 10, 10)
*圆形结构元素开运算
opening_circle (RegionOpening, RegionOpening1, 3.5)
*矩形结构元素闭运算
closing (RegionOpening1, RegionOpening1, RegionClosing)
*圆形结构元素闭运算
closing_circle (RegionClosing, RegionClosing1, 3.5)

你可能感兴趣的:(Halcon)