1、交集:两个ROI相交的部分
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
gen_circle (ROI_0, 65, 150, 43)
gen_circle (ROI_1, 155, 180, 63)
* 交集:两个ROI相交的部分
intersection (ROI_0, ROI_1, RegionIntersection)
dev_set_color ('blue')
dev_display (RegionIntersection)
2、补集:计算两个区域的差值
difference算子
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
gen_circle (ROI_0, 120, 120, 80)
gen_circle (ROI_1, 180, 170, 80)
difference (ROI_0, ROI_1, RegionDifference)
* 补集:相互的
dev_set_color ('blue')
dev_display (RegionDifference)
symm_difference算子
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
gen_circle (ROI_0, 150, 170, 130)
gen_circle (ROI_1, 210, 220, 130)
* 补集:相互的
symm_difference (ROI_0, ROI_1, RegionDifference1)
dev_set_color ('blue')
dev_display (RegionDifference1)
3、反选:选中输入区以外的区域
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
gen_circle (ROI_0, 70, 260, 50)
dev_set_color ('blue')
complement (ROI_0, RegionComplement)
dev_display (RegionComplement)
4、合并:合并完之后可以同时被选中
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'fabrik')
* 二值化
threshold (Image, Region, 128, 255)
* 连通性
connection (Region, ConnectedRegions)
* 合并所有区域
union1 (ConnectedRegions, RegionUnion)
dev_set_color ('blue')
dev_clear_window ()
dev_display (Image)
dev_display (RegionUnion)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
gen_rectangle1 (ROI_0, 49.3128, 265.992, 164.071, 361.677)
gen_rectangle1 (ROI_1, 132.544, 337.336, 205.687, 440.575)
* 合并两个区域可以单独也可以合并,合并完成之后就会同时被选中
union2 (ROI_0, ROI_1, RegionUnion)