get_region_polygonT_get_region_polygonGetRegionPolygonGetRegionPolygonget_region_polygon(算子)
名称
get_region_polygonT_get_region_polygonGetRegionPolygonGetRegionPolygonget_region_polygon — 区域的多边形近似。
签名
def get_region_polygon(region: HObject, tolerance: Union[int, float]) -> Tuple[Sequence[int], Sequence[int]]
描述
算子 get_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygonGetRegionPolygonget_region_polygon calculates a polygon to approximate the
edge of a region. A polygon is a sequence of line (RowsRowsRowsRowsrowsrows) and
column coordinates (ColumnsColumnsColumnsColumnscolumnscolumns). It describes the contour of the region.
Only the base points of the polygon are returned.
The parameter ToleranceToleranceToleranceTolerancetolerancetolerance indicates how large the maximum distance
between the polygon and the edge of the region may be.
Holes of the region are ignored.
The operator get_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygonGetRegionPolygonget_region_polygon returns the coordinates in the form of tuples.
注意
Holes of the region are ignored.
Only one region may be passed, and this region must have exactly
one connection component.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
RegionRegionRegionRegionregionregion (输入对象) region → objectHRegionHObjectHRegionHobject
Region to be approximated.
ToleranceToleranceToleranceTolerancetolerancetolerance (输入控制) number → HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Maximum distance between the polygon and the
edge of the region.
默认值:
5.0
建议值:
0.0, 2.0, 5.0, 10.0
值范围:
0.0
≤
Tolerance
Tolerance
Tolerance
Tolerance
tolerance
tolerance
(lin)
最小增量:
0.01
建议增量:
1.0
RowsRowsRowsRowsrowsrows (输出控制) polygon.y-array → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Line numbers of the base points of the contour.
ColumnsColumnsColumnsColumnscolumnscolumns (输出控制) polygon.x-array → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Column numbers of the base points of the contour.
元素数量:
Columns == Rows
结果
算子 get_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygonGetRegionPolygonget_region_polygon normally returns the value 2 ( H_MSG_TRUE )。
If more than one connection component is passed an exception is raised.
当输入为空(无可用输入区域)时,可设置行为通过算子 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。
可能的前趋
sobel_ampsobel_ampSobelAmpSobelAmpSobelAmpsobel_amp,
thresholdthresholdThresholdThresholdThresholdthreshold,
skeletonskeletonSkeletonSkeletonSkeletonskeleton,
edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image
另见
copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj,
gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygongen_region_polygon,
disp_polygondisp_polygonDispPolygonDispPolygonDispPolygondisp_polygon,
get_region_contourget_region_contourGetRegionContourGetRegionContourGetRegionContourget_region_contour,
set_line_approxset_line_approxSetLineApproxSetLineApproxSetLineApproxset_line_approx
模块
基础