Skip to content

gen_contour_region_xldgen_contour_region_xldGenContourRegionXldGenContourRegionXldgen_contour_region_xldgen_contour_region_xld🔗

Short description🔗

gen_contour_region_xldgen_contour_region_xldGenContourRegionXldGenContourRegionXldgen_contour_region_xldgen_contour_region_xld — Generate XLD contours from regions.

Signature🔗

gen_contour_region_xld( region Regions, out xld_cont Contours, string Mode )gen_contour_region_xld( Regions : Contours : Mode : )void GenContourRegionXld( const HObject& Regions, HObject* Contours, const HTuple& Mode )static void HOperatorSet.GenContourRegionXld( HObject regions, out HObject contours, HTuple mode )def gen_contour_region_xld( regions: HObject, mode: str ) -> HObject

Herror gen_contour_region_xld( const Hobject Regions, Hobject* Contours, const char* Mode )

Herror T_gen_contour_region_xld( const Hobject Regions, Hobject* Contours, const Htuple Mode )

void HXLDCont::HXLDCont( const HRegion& Regions, const HString& Mode )

void HXLDCont::HXLDCont( const HRegion& Regions, const char* Mode )

void HXLDCont::HXLDCont( const HRegion& Regions, const wchar_t* Mode ) (Windows only)

public HXLDCont( HRegion regions, string mode )

HXLDCont HRegion::GenContourRegionXld( const HString& Mode ) const

HXLDCont HRegion::GenContourRegionXld( const char* Mode ) const

HXLDCont HRegion::GenContourRegionXld( const wchar_t* Mode ) const (Windows only)

HXLDCont HRegion.GenContourRegionXld( string mode )

Description🔗

gen_contour_region_xldGenContourRegionXld generates XLD contours Contourscontourscontours from the regions given in Regionsregionsregions. This operator is useful if regions have been obtained from segmentation operations, but higher level operators, e.g., polygon approximation and extraction of parallels, are to be performed on their boundaries. For each connected component of the input regions a closed contour of the boundary is generated. The parameter Modemodemode can take on the following values:

  • 'center'"center": The centers of the border pixels are used as contour points.

  • 'border'"border": The outer border of the border pixels is used as contour points.

  • 'border_holes'"border_holes": In addition to the outer border of the input region you get the contours of all holes.

The difference between the modes is demonstrated using the following region:

Example region.

Computing the contour with the different values available for Modemodemode returns the following result contours:

 
(1) (2) (3)

Result for 'center'"center" (1), 'border'"border" (2), and 'border_holes'"border_holes" mode (3).

This means, for example, that contours generated with 'border'"border" will in general have a much larger Euclidean length (see length_xldLengthXld) than contours generated with 'center'"center". This results from the fact that for diagonal border elements 'border'"border" uses two contour segments of length 1 each, whereas 'center'"center" uses a single segment of length \(\sqrt{2}\). Other features, e.g., the area (see area_center_xldAreaCenterXld), will obviously also have different values.

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🔗

Regionsregionsregions (input_object) region(-array) → objectobjectHObjectHRegionHObjectHobject

Input regions.

Contourscontourscontours (output_object) xld_cont(-array) → objectobjectHObjectHXLDContHObjectHobject *

Resulting contours.

Modemodemode (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Mode of contour generation.

Default: 'border'"border"
List of values: 'border', 'border_holes', 'center'"border", "border_holes", "center"

Combinations with other operators🔗

Combinations

Possible successors

smooth_contours_xldSmoothContoursXld, gen_polygons_xldGenPolygonsXld

Alternatives

gen_contour_polygon_xldGenContourPolygonXld, get_region_contourGetRegionContour

See also

gen_contours_skeleton_xldGenContoursSkeletonXld

Module🔗

Foundation