区域的集合运算---complement,difference,intersection,union1,union2
程序员文章站
2022-05-29 09:21:41
...
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
gen_rectangle1 (Rectangle1, 100, 100, 150, 200)
gen_rectangle1 (Rectangle2, 50, 50, 200, 250)
*算子第一二个参数类型为Image,如果类型为区域则计算无效,最终输出结果是算子的第二个参数Rectangle1
reduce_domain (Rectangle2, Rectangle1, ImageReduced)
difference (Rectangle2, Rectangle1, RegionDifference1)
*计算区域的补集,用窗口的全部区域减去该区域的差集
complement (Rectangle2, RegionComplement)
*返回所有输入区域的并集,该区域的全部
gen_rectangle2 (Rectangle3, 200, 200, 0, 100, 50)
*返回连个区域的并集
union2 (Rectangle2, Rectangle3, RegionUnion2)
*计算两个区域的交集
intersection (Rectangle2, Rectangle3, RegionIntersection)