gen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXldgen_polygons_xld (Operator)
Name
gen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXldgen_polygons_xld
— Approximate XLD contours by polygons.
Signature
def gen_polygons_xld(contours: HObject, type: str, alpha: Union[float, int]) -> HObject
Description
gen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXldgen_polygons_xld
approximates XLD contours
(ContoursContoursContourscontourscontours
) by polygons. The type of the approximation
can be set by TypeTypeTypetypetype
. The threshold for the approximation
is set via AlphaAlphaAlphaalphaalpha
. The procedure is able to process open
as well as closed contours. The resulting approximating XLD
polygons are returned in PolygonsPolygonsPolygonspolygonspolygons
.
Contours can be approximated by the algorithm of Ramer, which
approximates contours such that the Euclidean distance of the
approximating polygon to the contour is at most AlphaAlphaAlphaalphaalpha
pixel
units.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
ContoursContoursContourscontourscontours
(input_object) xld_cont-array →
objectHXLDContHObjectHObjectHobject
Contours to be approximated.
PolygonsPolygonsPolygonspolygonspolygons
(output_object) xld_poly-array →
objectHXLDPolyHObjectHObjectHobject *
Approximating polygons.
TypeTypeTypetypetype
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Type of approximation.
Default:
'ramer'
"ramer"
"ramer"
"ramer"
"ramer"
List of values:
'ramer'"ramer""ramer""ramer""ramer"
AlphaAlphaAlphaalphaalpha
(input_control) number →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Threshold for the approximation.
Default:
2.0
Suggested values:
1.0, 1.5, 2.0, 3.0, 4.0
Restriction:
Alpha > 0.0
Possible Predecessors
gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld
,
lines_gausslines_gaussLinesGaussLinesGausslines_gauss
,
lines_facetlines_facetLinesFacetLinesFacetlines_facet
,
edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixedges_sub_pix
Possible Successors
gen_parallels_xldgen_parallels_xldGenParallelsXldGenParallelsXldgen_parallels_xld
,
split_contours_xldsplit_contours_xldSplitContoursXldSplitContoursXldsplit_contours_xld
See also
get_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygonget_region_polygon
Module
Foundation