Skip to content

get_region_contourget_region_contourGetRegionContourGetRegionContourget_region_contourT_get_region_contour🔗

Short description🔗

get_region_contourget_region_contourGetRegionContourGetRegionContourget_region_contourT_get_region_contour — Access the contour of an object.

Signature🔗

get_region_contour( region Region, out contour.y Rows, out contour.x Columns )get_region_contour( Region : : : Rows, Columns )void GetRegionContour( const HObject& Region, HTuple* Rows, HTuple* Columns )static void HOperatorSet.GetRegionContour( HObject region, out HTuple rows, out HTuple columns )def get_region_contour( region: HObject ) -> Tuple[Sequence[int], Sequence[int]]

Herror T_get_region_contour( const Hobject Region, Htuple* Rows, Htuple* Columns )

void HRegion::GetRegionContour( HTuple* Rows, HTuple* Columns ) const

void HRegion.GetRegionContour( out HTuple rows, out HTuple columns )

Description🔗

The operator get_region_contourGetRegionContour returns the contour of a region. A contour is a result of line (Rowsrowsrows) and column coordinates (Columnscolumnscolumns), describing the boundary of the region. The contour lies on the region. It starts at the smallest line number. In that line at the pixel with the largest column index. The rotation direction is clockwise. The first pixel of the contour is identical with the last. Holes of the region are ignored. The operator get_region_contourGetRegionContour returns the coordinates in the form of tuples. An empty region is passed as empty tuple.

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 → objectobjectHObjectHRegionHObjectHobject

Output region.

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

Line numbers of the contour pixels.

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

Column numbers of the contour pixels.

Number of elements: Columns == Rows

Result🔗

The operator get_region_contourGetRegionContour 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, gen_rectangle1GenRectangle1, gen_circleGenCircle

See also

copy_objCopyObj, get_region_polygonGetRegionPolygon

Module🔗

Foundation