区域的反选
dev_open_window(0, 0, 512, 512, ‘black’, WindowHandle)//打开窗口,背景黑色
gen_circle(Circle, 200, 200, 100.5)//画圆
dev_clear_window()//清除窗口
complement(Circle, RegionComplement)//反选圆以外的区域
区域的补集
dev_open_window(0, 0, 512, 512, ‘black’, WindowHandle)
gen_circle(Circle1, 122.5, 126.5, 69.5) //画圆1
gen_circle(Circle2, 184.5, 179.5, 73)//画圆2
difference(Circle1,Circle2,RegionDifference)//求圆1的补集
dev_clear_window()//清除窗口
dev_display(RegionDifference)//显示补集
区域交集的补集
dev_open_window(0, 0, 512, 512, ‘black’, WindowHandle)
gen_circle(Circle1, 122.5, 126.5, 69.5) //画圆1
gen_circle(Circle2, 184.5, 179.5, 73)//画圆2
symm_difference(Circle1,Circle2,RegionDifference)//求圆1的补集
dev_clear_window()//清除窗口
dev_display(RegionDifference)//显示补集
区域交集
dev_open_window(0, 0, 512, 512, ‘black’, WindowHandle)
gen_circle(Circle1, 122.5, 126.5, 69.5) //画圆1
gen_circle(Circle2, 184.5, 179.5, 73)//画圆2
intersection(Circle1,Circle2,RegionDifference)//求圆1的补集
dev_clear_window()//清除窗口
dev_display(RegionDifference)//显示补集
Union1所有区域合并
dev_open_window(0, 0, 512, 512, ‘black’, WindowHandle)
read_image(Image, ‘fabrik’)
dev_set_colored(12)//设置所有区域的颜色有12种
threshold(Image, Region, 128, 255)//阈值找出该区间的区域
connection(Region, ConnectedRegions)//相邻区域合并,不相邻区域分割
union1(ConnectedRegions, RegionUnion)//所有区域合并为一个区域
dev_clear_window()
dev_display(Image)
dev_display(RegionUnion)