17、对ROI进行操作
1、union2(Region1, Region2 : RegionUnion : : ) 对象是region 1
2、union1(Region : RegionUnion : : ) 对象是region 2
3、union2_closed_contours_xld(Contours1, Contours2 : ContoursUnion : : ) 对象是xld contours 3
4、union2_closed_polygons_xld(Polygons1, Polygons2 : PolygonsUnion : : ) 对象是xld polygons 5
6、concat_obj(Objects1, Objects2 : ObjectsConcat : : ) 对象既可以使region也可以是xld polygons、xld contours 6
1、intersection(Region1, Region2 : RegionIntersection : : ) 对象是region 8
2、intersection_closed_contours_xld(Contours1, Contours2 : ContoursIntersection : : ) 对像是xld 9
1、difference(Region, Sub : RegionDifference : : ) 对象为region 11
2、difference_closed_contours_xld(Contours, Sub : ContoursDifference : : ) 对象为xld contours 12
3、difference_closed_polygons_xld(Polygons, Sub : PolygonsDifference : : ) 对象为xld polygons 13
1、symm_difference(Region1, Region2 : RegionDifference : : ) 对象为region 14
1、complement(Region : RegionComplement : : ) 17
一、并集
1、union2(Region1, Region2 : RegionUnion : : ) 对象是region
功能:计算两个区域的并集
read_image(Image,'lena')
draw_circle (3600, Row, Column, Radius)
gen_circle (Circle, Row, Column, Radius)
draw_rectangle1 (3600, Row1, Column1, Row2, Column2)
gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)
union2(Circle,Rectangle,eee)
2、union1(Region : RegionUnion : : ) 对象是region
功能:把一个区域(这个区域中有很多小的区域,如connection()算子操作后的region),重新联合成一个整体。
是connection()算子的反操作。
draw_circle (3600, Row, Column, Radius)
gen_circle (Circle, Row, Column, Radius)
draw_rectangle1 (3600, Row1, Column1, Row2, Column2)
gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)
注意:connection()操作后的out区域是把每个独立分开(out此时其实是一个数组)可以通过修改显示颜色数
来显示不同颜色,而eee和out1是一个整体,无论它的颜色数量是多少都只能显示一种颜色。
3、union2_closed_contours_xld(Contours1, Contours2 : ContoursUnion : : ) 对象是xld contours
功能:计算封闭轮廓的并集,如果输入的轮廓不是闭合的,算子会自动连接轮廓的首尾,把轮廓并集在进行运算
gen_circle_contour_xld (ContCircle, 200, 200, 100, 0, 4, 'positive', 1)
gen_rectangle1 (Rectangle, 40, 40, 200, 200)
gen_contour_region_xld (Rectangle, Contours, 'border')
union2_closed_contours_xld (ContCircle, Contours, ContoursUnion)
gen_circle_contour_xld (ContCircle, 200, 200, 100, 0, 4, 'positive', 1)
gen_circle_contour_xld (ContCircle1, 100, 400, 100, 0, 2, 'positive', 1)
union2_closed_contours_xld (ContCircle, ContCircle1, ContoursUnion)
注:最终联合起来的轮廓是用不同颜色来表示的,则说明它们一分开联通(像是用connection算子操作过的效果)
4、union2_closed_polygons_xld(Polygons1, Polygons2 : PolygonsUnion : : ) 对象是xld polygons
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
gen_contour_region_xld (Rectangle, xld1, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld1, Polygons1, 'ramer', 2)//把xld contour转换为xld polygon
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
gen_contour_region_xld (Circle, xld2, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld2, Polygons2, 'ramer', 2)//把xld contour转换为xld polygon
union2_closed_polygons_xld (Polygons1, Polygons2, PolygonsIntersection)
5、union_adjacent_contours_xld(Contours : UnionContours : MaxDistAbs, MaxDistRel, Mode : ) ----??????
功能:计算多个轮廓构成的并集。每个轮廓的端点分别与相邻最近的端点线连接。
6、concat_obj(Objects1, Objects2 : ObjectsConcat : : ) 对象既可以使region也可以是xld polygons、xld contours
concat_obj (re1, re2, ObjectsConcat)
gen_circle_contour_xld (ContCircle1, 200, 200, 100, 0, 1, 'positive', 1)
gen_circle_contour_xld (ContCircle, 200, 200, 100, 2, 3, 'positive', 1)
concat_obj (ContCircle1, ContCircle, ObjectsConcat)
MaxDist, MaxRadiusDiff, MaxCenterDist, MergeSmallContours, Iterations : ) 对象是xld contours
MaxArcAngleDiff:公园的第一圆弧的终点与第二圆弧的起点的最大角度
MaxTangentAngle:养护的切线和连接线的最大角度
MaxTangentAngle:第一个圆弧终点与第二个圆弧起点之间的最大绝对距离
MaxRadiusDiff:两个圆弧你和的圆的半径的最大绝对误差
MergeSmallContours:确定没有用来你和圆的小轮廓时候用来合并
gen_circle_contour_xld (ContCircle1, 200, 200, 100, 0, 1, 'positive', 1)
gen_circle_contour_xld (ContCircle, 200, 200, 100, 2, 3, 'positive', 1)
concat_obj (ContCircle1, ContCircle, ObjectsConcat)
union_cocircular_contours_xld (ObjectsConcat, UnionContours, 2, 1, 1, 100, 50, 30, 'false', 1)
1、intersection(Region1, Region2 : RegionIntersection : : ) 对象是region
draw_rectangle1 (3600, y1, x1, y2, x2)
gen_rectangle1 (Rectangle, y1, x1, y2, x2)
intersection (Circle, Rectangle, RegionIntersection)
2、intersection_closed_contours_xld(Contours1, Contours2 : ContoursIntersection : : ) 对像是xld
gen_contour_region_xld (Circle, xld1, 'border')//region转换为xld
draw_rectangle1 (3600, y1, x1, y2, x2)
gen_rectangle1 (Rectangle, y1, x1, y2, x2)
gen_contour_region_xld (Rectangle, xld2, 'border')//region转换为xld
intersection_closed_contours_xld (xld1, xld2, ContoursIntersection)
3、intersection_closed_polygons_xld(Polygons1, Polygons2 : PolygonsIntersection : : ) 对象是xld polygons
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
gen_contour_region_xld (Rectangle, xld1, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld1, Polygons1, 'ramer', 2)//把xld contour转换为xld polygon
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
gen_contour_region_xld (Circle, xld2, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld2, Polygons2, 'ramer', 2)//把xld contour转换为xld polygon
intersection_closed_polygons_xld (Polygons1, Polygons2, PolygonsIntersection)
1、difference(Region, Sub : RegionDifference : : ) 对象为region
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
difference (Rectangle, Circle, RegionDifference)
2、difference_closed_contours_xld(Contours, Sub : ContoursDifference : : ) 对象为xld contours
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
gen_contour_region_xld (Rectangle, xld1, 'border')//把region转化为xld contour
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
gen_contour_region_xld (Circle, xld2, 'border')//把region转化为xld contour
difference_closed_contours_xld (xld1, xld2, ContoursDifference)
3、difference_closed_polygons_xld(Polygons, Sub : PolygonsDifference : : ) 对象为xld polygons
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
gen_contour_region_xld (Rectangle, xld1, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld1, Polygons1, 'ramer', 2)//把xld contour转换为xld polygon
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
gen_contour_region_xld (Circle, xld2, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld2, Polygons2, 'ramer', 2)//把xld contour转换为xld polygon
difference_closed_polygons_xld (Polygons1, Polygons2, PolygonsDifference)
1、symm_difference(Region1, Region2 : RegionDifference : : ) 对象为region
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
symm_difference (Rectangle, Circle, RegionDifference)
功能:计算两个闭合轮廓的对称差(xld contuors不像region,region表示一块区域,而xld contuors只表示边界轮
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
gen_contour_region_xld (Rectangle, xld1, 'border')//把region转化为xld contour
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
gen_contour_region_xld (Circle, xld2, 'border')//把region转化为xld contour
symm_difference_closed_contours_xld (xld1, xld2, ContoursDifference)
分析:由于xld contuors只表示边界轮廓线,所以xld1和xld2轮廓线相交时只有两个点重叠,说以进行对称差(异
draw_rectangle1 (3600, y2, x2, y3, x3)
gen_rectangle1 (Rectangle, y2, x2, y3, x3)
gen_contour_region_xld (Rectangle, xld1, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld1, Polygons1, 'ramer', 2)//把xld contour转换为xld polygon
draw_circle (3600, y1, x1, R1)
gen_circle (Circle, y1, x1, R1)
gen_contour_region_xld (Circle, xld2, 'border')//把region转化为xld contour
* gen_polygons_xld()用多边形逼近XLD轮廓
gen_polygons_xld (xld2, Polygons2, 'ramer', 10)
symm_difference_closed_polygons_xld (Polygons2, Polygons1, PolygonsDifference)
1、complement(Region : RegionComplement : : )