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

gen_parallels_xldgen_parallels_xldgen_parallels_xldGenParallelsXldGenParallelsXld (Operator)

Name

gen_parallels_xldgen_parallels_xldgen_parallels_xldGenParallelsXldGenParallelsXld — Extract parallel XLD polygons.

Signature

gen_parallels_xld(Polygons : Parallels : Len, Dist, Alpha, Merge : )

Herror gen_parallels_xld(const Hobject Polygons, Hobject* Parallels, double Len, double Dist, double Alpha, const char* Merge)

Herror T_gen_parallels_xld(const Hobject Polygons, Hobject* Parallels, const Htuple Len, const Htuple Dist, const Htuple Alpha, const Htuple Merge)

Herror gen_parallels_xld(Hobject Polygons, Hobject* Parallels, const HTuple& Len, const HTuple& Dist, const HTuple& Alpha, const HTuple& Merge)

HXLDParaArray HXLDPolyArray::GenParallelsXld(const HTuple& Len, const HTuple& Dist, const HTuple& Alpha, const HTuple& Merge) const

void HOperatorSetX.GenParallelsXld(
[in] IHUntypedObjectX* Polygons, [out] IHUntypedObjectX*Parallels, [in] VARIANT Len, [in] VARIANT Dist, [in] VARIANT Alpha, [in] VARIANT Merge)

IHXLDParaX* HXLDPolyX.GenParallelsXld(
[in] VARIANT Len, [in] VARIANT Dist, [in] VARIANT Alpha, [in] BSTR Merge)

static void HOperatorSet.GenParallelsXld(HObject polygons, out HObject parallels, HTuple len, HTuple dist, HTuple alpha, HTuple merge)

HXLDPara HXLDPoly.GenParallelsXld(HTuple len, HTuple dist, HTuple alpha, string merge)

HXLDPara HXLDPoly.GenParallelsXld(double len, double dist, double alpha, string merge)

Description

gen_parallels_xldgen_parallels_xldgen_parallels_xldGenParallelsXldGenParallelsXld examines the XLD polygons passed in PolygonsPolygonsPolygonsPolygonspolygons for parallelism. The resulting parallel polygons are returned in ParallelsParallelsParallelsParallelsparallels. If the parameter MergeMergeMergeMergemerge is set to 'true'"true""true""true""true", adjacent parallel polygons are returned in a single parallel relation. Otherwise, one parallel relation is returned for each pair of parallel line segments. Whether two polygon segments are parallel depends on their distance (smaller than DistDistDistDistdist), a maximum allowed angle difference (AlphaAlphaAlphaAlphaalpha, in radians), and a minimum length of the two polygon segments. Furthermore, the two segments have to overlap. As a side effect, a quality factor is calculated for each pair of parallels. It is based on the normalized angular difference and the normalized length of the overlapping area:

          PI-delta_alpha   2*overlap
quality = -------------- * ---------    with (0 <= quality <= 1)
               PI/2        len1+len2

Here, delta_alpha is the angle difference of the polygon segments, overlap is the length of the overlap area, len1 and len2 the length of the polygon segments, and quality the resulting quality factor.

The quality factor is a measure of parallelism (the larger its value, the “more parallel” the polygons). Finally, the quality factors of all parallel polygon segments contained in a single polygon are added, weighted with their length of the overlapping area.

Parallelization

Parameters

PolygonsPolygonsPolygonsPolygonspolygons (input_object)  xld_poly-array objectHXLDPolyHXLDPolyArrayHXLDPolyXHobject

Input polygons.

ParallelsParallelsParallelsParallelsparallels (output_object)  xld_para-array objectHXLDParaHXLDParaArrayHXLDParaXHobject *

Parallel polygons.

LenLenLenLenlen (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Minimum length of the individual polygon segments.

Default value: 10.0

Suggested values: 5.0, 10.0, 15.0, 20.0

Restriction: Len > 0.0

DistDistDistDistdist (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Maximum distance between the polygon segments.

Default value: 30.0

Suggested values: 20.0, 25.0, 30.0, 40.0, 50.0, 75.0

Restriction: Dist > 0.0

AlphaAlphaAlphaAlphaalpha (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Maximum angle difference of the polygon segments.

Default value: 0.15

Suggested values: 0.05, 0.10, 0.15, 0.20, 0.30

Restriction: (0 <= Alpha) && (Alpha <= (pi / 2))

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

Should adjacent parallel relations be merged?

Default value: 'true' "true" "true" "true" "true"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

Possible Predecessors

gen_polygons_xldgen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXld

Possible Successors

mod_parallels_xldmod_parallels_xldmod_parallels_xldModParallelsXldModParallelsXld, get_parallels_xldget_parallels_xldget_parallels_xldGetParallelsXldGetParallelsXld

Module

Foundation


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