ClassesClassesClassesClasses | | | | Operators

gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld (Operator)

Name

gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld — Approximate XLD contours by polygons.

Signature

gen_polygons_xld(Contours : Polygons : Type, Alpha : )

Herror gen_polygons_xld(const Hobject Contours, Hobject* Polygons, const char* Type, double Alpha)

Herror T_gen_polygons_xld(const Hobject Contours, Hobject* Polygons, const Htuple Type, const Htuple Alpha)

Herror gen_polygons_xld(Hobject Contours, Hobject* Polygons, const HTuple& Type, const HTuple& Alpha)

HXLDPolyArray HXLDContArray::GenPolygonsXld(const HTuple& Type, const HTuple& Alpha) const

void GenPolygonsXld(const HObject& Contours, HObject* Polygons, const HTuple& Type, const HTuple& Alpha)

HXLDPoly HXLDCont::GenPolygonsXld(const HString& Type, const HTuple& Alpha) const

HXLDPoly HXLDCont::GenPolygonsXld(const HString& Type, double Alpha) const

HXLDPoly HXLDCont::GenPolygonsXld(const char* Type, double Alpha) const

void HOperatorSetX.GenPolygonsXld(
[in] IHUntypedObjectX* Contours, [out] IHUntypedObjectX*Polygons, [in] VARIANT Type, [in] VARIANT Alpha)

IHXLDPolyX* HXLDContX.GenPolygonsXld(
[in] BSTR Type, [in] VARIANT Alpha)

static void HOperatorSet.GenPolygonsXld(HObject contours, out HObject polygons, HTuple type, HTuple alpha)

HXLDPoly HXLDCont.GenPolygonsXld(string type, HTuple alpha)

HXLDPoly HXLDCont.GenPolygonsXld(string type, double alpha)

Description

gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld approximates XLD contours (ContoursContoursContoursContoursContourscontours) by polygons. The type of the approximation can be set by TypeTypeTypeTypeTypetype. The threshold for the approximation is set via AlphaAlphaAlphaAlphaAlphaalpha. The procedure is able to process open as well as closed contours. The resulting approximating XLD polygons are returned in PolygonsPolygonsPolygonsPolygonsPolygonspolygons.

Contours can be approximated by the algorithms of Ramer, Ray, and Sato. The algorithm of Ramer approximates contours such that the Euclidian distance of the approximating polygon to the contour is at most AlphaAlphaAlphaAlphaAlphaalpha pixel units. The algorithm of Ray does not need a threshold, and hence AlphaAlphaAlphaAlphaAlphaalpha is ignored. Here, the contour is approximated by maximizing the line length, while minimizing the sum of the distances of the line segment from the contour. The algorithm of Sato produces a polygon point at the point of the contour in which the distance to the end points of the contour is maximal. The total approximation error for each iteration is then given by (L - L')/L, where L is the Euclidian contour length, and L' is the length of the approximating polygon.

Parallelization

Parameters

ContoursContoursContoursContoursContourscontours (input_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject

Contours to be approximated.

PolygonsPolygonsPolygonsPolygonsPolygonspolygons (output_object)  xld_poly-array objectHXLDPolyHXLDPolyHXLDPolyArrayHXLDPolyXHobject *

Approximating polygons.

TypeTypeTypeTypeTypetype (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Type of approximation.

Default value: 'ramer' "ramer" "ramer" "ramer" "ramer" "ramer"

List of values: 'ramer'"ramer""ramer""ramer""ramer""ramer", 'ray'"ray""ray""ray""ray""ray", 'sato'"sato""sato""sato""sato""sato"

AlphaAlphaAlphaAlphaAlphaalpha (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Threshold for the approximation.

Default value: 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_xldGenContoursSkeletonXldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld, lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss, lines_facetlines_facetLinesFacetlines_facetLinesFacetLinesFacet, edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix

Possible Successors

gen_parallels_xldgen_parallels_xldGenParallelsXldgen_parallels_xldGenParallelsXldGenParallelsXld, split_contours_xldsplit_contours_xldSplitContoursXldsplit_contours_xldSplitContoursXldSplitContoursXld

See also

get_region_polygonget_region_polygonGetRegionPolygonget_region_polygonGetRegionPolygonGetRegionPolygon

Module

Foundation


ClassesClassesClassesClasses | | | | Operators