Skip to content

get_region_polygonGetRegionPolygonGetRegionPolygonget_region_polygonT_get_region_polygon🔗

Short description🔗

get_region_polygonGetRegionPolygonGetRegionPolygonget_region_polygonT_get_region_polygon — Polygon approximation of a region.

Signature🔗

get_region_polygon( region Region, number Tolerance, out polygon.y Rows, out polygon.x Columns )void GetRegionPolygon( const HObject& Region, const HTuple& Tolerance, HTuple* Rows, HTuple* Columns )static void HOperatorSet.GetRegionPolygon( HObject region, HTuple tolerance, out HTuple rows, out HTuple columns )def get_region_polygon( region: HObject, tolerance: Union[int, float] ) -> Tuple[Sequence[int], Sequence[int]]

Herror T_get_region_polygon( const Hobject Region, const Htuple Tolerance, Htuple* Rows, Htuple* Columns )

void HRegion::GetRegionPolygon( const HTuple& Tolerance, HTuple* Rows, HTuple* Columns ) const

void HRegion::GetRegionPolygon( double Tolerance, HTuple* Rows, HTuple* Columns ) const

void HRegion.GetRegionPolygon( HTuple tolerance, out HTuple rows, out HTuple columns )

void HRegion.GetRegionPolygon( double tolerance, out HTuple rows, out HTuple columns )

Description🔗

The operator get_region_polygonGetRegionPolygon calculates a polygon to approximate the edge of a region. A polygon is a sequence of line (Rowsrowsrows) and column coordinates (Columnscolumnscolumns). It describes the contour of the region. Only the base points of the polygon are returned. The parameter Tolerancetolerancetolerance 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_polygonGetRegionPolygon returns the coordinates in the form of tuples.

Attention🔗

Holes of the region are ignored. Only one region may be passed, and this region must have exactly one connection component.

Execution information🔗

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🔗

Regionregionregion (input_object) region → objectHObjectHRegionHObjectHobject

Region to be approximated.

Tolerancetolerancetolerance (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Maximum distance between the polygon and the edge of the region.

Default: 5.05.0
Suggested values: 0.0, 2.0, 5.0, 10.00.0, 2.0, 5.0, 10.0
Value range: 0.0 ≤ Tolerance (lin)
Minimum increment: 0.01
Recommended increment: 1.0

Rowsrowsrows (output_control) polygon.y-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Line numbers of the base points of the contour.

Columnscolumnscolumns (output_control) polygon.x-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Column numbers of the base points of the contour.

Number of elements: Columns == Rows

Result🔗

The operator get_region_polygonGetRegionPolygon normally returns the value 2 (H_MSG_TRUE). If more than one connection component is passed an exception is raised. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>).

Combinations with other operators🔗

Combinations

Possible predecessors

sobel_ampSobelAmp, thresholdThreshold, skeletonSkeleton, edges_imageEdgesImage

See also

copy_objCopyObj, gen_region_polygonGenRegionPolygon, disp_polygonDispPolygon, get_region_contourGetRegionContour, set_line_approxSetLineApprox

Module🔗

Foundation