HALCON Reference Manual 10.0.2
Table of Contents / XLD / Creation ClassesClassesClasses | | | Operators

gen_contours_skeleton_xldgen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld (Operator)

Name

gen_contours_skeleton_xldgen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld — Convert a skeleton into XLD contours.

Signature

gen_contours_skeleton_xld(Skeleton : Contours : Length, Mode : )

Herror gen_contours_skeleton_xld(const Hobject Skeleton, Hobject* Contours, const Hlong Length, const char* Mode)

Herror T_gen_contours_skeleton_xld(const Hobject Skeleton, Hobject* Contours, const Htuple Length, const Htuple Mode)

Herror gen_contours_skeleton_xld(Hobject Skeleton, Hobject* Contours, const HTuple& Length, const HTuple& Mode)

HXLDContArray HRegion::GenContoursSkeletonXld(const HTuple& Length, const HTuple& Mode) const

void HOperatorSetX.GenContoursSkeletonXld(
[in] IHUntypedObjectX* Skeleton, [out] IHUntypedObjectX*Contours, [in] VARIANT Length, [in] VARIANT Mode)

IHXLDContX* HRegionX.GenContoursSkeletonXld(
[in] Hlong Length, [in] BSTR Mode)

static void HOperatorSet.GenContoursSkeletonXld(HObject skeleton, out HObject contours, HTuple length, HTuple mode)

HXLDCont HRegion.GenContoursSkeletonXld(int length, string mode)

Description

gen_contours_skeleton_xldgen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld converts the input skeleton (e.g., edges) SkeletonSkeletonSkeletonSkeletonskeleton, which is assumed to contain mostly one pixel wide regions (see skeletonskeletonskeletonSkeletonSkeleton), into XLD contours. The regions are first transformed to contain only line segments in 8-neighborhood. In the process 12 special configurations are taken into account: Points for which there is a junction of three or more lines in 8-neighborhood are preserved (in all four rotations):

  0  0  1     0  1  0     0  1  0
  1  1  0     0  1  1     1  1  1
  0  1  0     0  1  0     0  1  0

In a second step, all junction points are labelled, taking six different characteristic configurations of all four possible rotations into account:

  1  0  1     1  0  1     1  0  0     1  0  0     0  1  0     0  1  0
  0  2  0     0  2  0     0  2  1     0  2  1     0  2  1     1  2  1
  0  0  1     1  0  1     0  1  0     1  0  0     0  1  0     0  1  0

where 0 = background, 1 = foreground, and 2 = junction point.

After this, all contours having at least LengthLengthLengthLengthlength points are returned. The contours generated by gen_contours_skeleton_xldgen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld always end in junction or end points. For closed contours the first point lies in the 8-neighborhood of the last point of the contour. Therefore, in order to determine the adjacency of contours it is sufficient to just take the end points into account.

Since contours are split at junction points, possibly long contours may be split into several short segments because of short adjacent lines, even if they are longer than LengthLengthLengthLengthlength points, if ModeModeModeModemode = 'filter' was selected. This can be avoided by setting ModeModeModeModemode = 'generalize1'. In this case, the contours are generated as if the segments shorter than LengthLengthLengthLengthlength were not contained in the input region. In order to preserve line segments, which are split into very short segments by the crossing of short lines, ModeModeModeModemode = 'generalize2' can be selected. In this case, line segments are preserved if they end in two junction points, even if they are shorter than LengthLengthLengthLengthlength.

Parallelization

Parameters

SkeletonSkeletonSkeletonSkeletonskeleton (input_object)  region objectHRegionHRegionHRegionXHobject

Skeleton of which the contours are to be determined.

ContoursContoursContoursContourscontours (output_object)  xld_cont-array objectHXLDContHXLDContArrayHXLDContXHobject *

Resulting contours.

LengthLengthLengthLengthlength (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Minimum number of points a contour has to have.

Default value: 1

Suggested values: 1, 2, 3, 5, 10, 20

ModeModeModeModemode (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Contour filter mode.

Default value: 'filter' "filter" "filter" "filter" "filter"

List of values: 'filter'"filter""filter""filter""filter", 'generalize1'"generalize1""generalize1""generalize1""generalize1", 'generalize2'"generalize2""generalize2""generalize2""generalize2"

Possible Predecessors

skeletonskeletonskeletonSkeletonSkeleton

Possible Successors

smooth_contours_xldsmooth_contours_xldsmooth_contours_xldSmoothContoursXldSmoothContoursXld, get_contour_xldget_contour_xldget_contour_xldGetContourXldGetContourXld, gen_polygons_xldgen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXld

See also

edges_imageedges_imageedges_imageEdgesImageEdgesImage, thresholdthresholdthresholdThresholdThreshold, get_region_contourget_region_contourget_region_contourGetRegionContourGetRegionContour

Module

Foundation


Table of Contents / XLD / Creation ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH