ClassesClassesClassesClasses | | | | Operators

union_straight_contours_xldunion_straight_contours_xldUnionStraightContoursXldunion_straight_contours_xldUnionStraightContoursXldUnionStraightContoursXld (Operator)

Name

union_straight_contours_xldunion_straight_contours_xldUnionStraightContoursXldunion_straight_contours_xldUnionStraightContoursXldUnionStraightContoursXld — Compute the union of neighboring straight contours that have a similar direction.

Signature

union_straight_contours_xld(Contours : UnionContours : MaxDist, MaxDiff, Percent, Mode, Iterations : )

Herror union_straight_contours_xld(const Hobject Contours, Hobject* UnionContours, double MaxDist, double MaxDiff, double Percent, const char* Mode, const char* Iterations)

Herror T_union_straight_contours_xld(const Hobject Contours, Hobject* UnionContours, const Htuple MaxDist, const Htuple MaxDiff, const Htuple Percent, const Htuple Mode, const Htuple Iterations)

Herror union_straight_contours_xld(Hobject Contours, Hobject* UnionContours, const HTuple& MaxDist, const HTuple& MaxDiff, const HTuple& Percent, const HTuple& Mode, const HTuple& Iterations)

HXLDContArray HXLDContArray::UnionStraightContoursXld(const HTuple& MaxDist, const HTuple& MaxDiff, const HTuple& Percent, const HTuple& Mode, const HTuple& Iterations) const

void UnionStraightContoursXld(const HObject& Contours, HObject* UnionContours, const HTuple& MaxDist, const HTuple& MaxDiff, const HTuple& Percent, const HTuple& Mode, const HTuple& Iterations)

HXLDCont HXLDCont::UnionStraightContoursXld(double MaxDist, double MaxDiff, double Percent, const HString& Mode, const HTuple& Iterations) const

HXLDCont HXLDCont::UnionStraightContoursXld(double MaxDist, double MaxDiff, double Percent, const HString& Mode, const HString& Iterations) const

HXLDCont HXLDCont::UnionStraightContoursXld(double MaxDist, double MaxDiff, double Percent, const char* Mode, const char* Iterations) const

void HOperatorSetX.UnionStraightContoursXld(
[in] IHUntypedObjectX* Contours, [out] IHUntypedObjectX*UnionContours, [in] VARIANT MaxDist, [in] VARIANT MaxDiff, [in] VARIANT Percent, [in] VARIANT Mode, [in] VARIANT Iterations)

IHXLDContX* HXLDContX.UnionStraightContoursXld(
[in] double MaxDist, [in] double MaxDiff, [in] double Percent, [in] BSTR Mode, [in] VARIANT Iterations)

static void HOperatorSet.UnionStraightContoursXld(HObject contours, out HObject unionContours, HTuple maxDist, HTuple maxDiff, HTuple percent, HTuple mode, HTuple iterations)

HXLDCont HXLDCont.UnionStraightContoursXld(double maxDist, double maxDiff, double percent, string mode, HTuple iterations)

HXLDCont HXLDCont.UnionStraightContoursXld(double maxDist, double maxDiff, double percent, string mode, string iterations)

Description

union_straight_contours_xldunion_straight_contours_xldUnionStraightContoursXldunion_straight_contours_xldUnionStraightContoursXldUnionStraightContoursXld merges neighboring XLD contours ContoursContoursContoursContoursContourscontours if certain criteria are fulfilled. At each iteration, at most two contours that fulfill the given criteria are merged. The parameter IterationsIterationsIterationsIterationsIterationsiterations controls how often this step is executed.

Two contours are merged if the shortest distance between their end points (end points are the projections of the contours' first and last points onto its regression line) is smaller than MaxDistMaxDistMaxDistMaxDistMaxDistmaxDist, and if the difference in direction (i.e., the regression lines' direction) is smaller than MaxDiffMaxDiffMaxDiffMaxDiffMaxDiffmaxDiff (radians).

If only one of the criteria is fulfilled, the decision on merging can be influenced by the weighting factor PercentPercentPercentPercentPercentpercent, which allows the exceeding of one limit to be balanced by the other value remaining below the limit by the same amount. The end point distance is weighted by PercentPercentPercentPercentPercentpercent, while the directional difference is weighted by 100 - Percent.

This means that two contours are merged if they fulfill the following condition:

(shortest distance)/MaxDist*Percent + (direction difference)/MaxDiff*(100-Percent) <= 100

If, for example, two contours have an end point distance of 5.0 and a directional difference of 0.5 (with the limits chosen being MaxDistMaxDistMaxDistMaxDistMaxDistmaxDist = 4.0 and MaxDiffMaxDiffMaxDiffMaxDiffMaxDiffmaxDiff = 0.625), both values differ from the limits by 25%. By choosing PercentPercentPercentPercentPercentpercent = 60%, the larger end point distance is weigthed more than the smaller directional difference, and thus the contours are not merged. Contrary, if PercentPercentPercentPercentPercentpercent = 40% is chosen, the contours are merged.

For PercentPercentPercentPercentPercentpercent = 100%, only the end point distance is taken into account, while for PercentPercentPercentPercentPercentpercent = 0% only the difference of direction is used. If PercentPercentPercentPercentPercentpercent = 50% both criteria are equally valid.

In case there are parallel contours, there is a danger of merging neighboring contours. If this is to be avoided, ModeModeModeModeModemode = 'noparallel' has to be chosen, while otherwise ModeModeModeModeModemode = 'paralleltoo' suffices. For ModeModeModeModeModemode = 'every', contours are merged unconditionally. All other parameters have no influence in this case.

The parameters of the regression line are calculated anew for merged contours.

Attention

Before the contour parameters can be returned by get_regress_params_xldget_regress_params_xldGetRegressParamsXldget_regress_params_xldGetRegressParamsXldGetRegressParamsXld, the parameters of the regression line to the contour must be calculated by calling regress_contours_xldregress_contours_xldRegressContoursXldregress_contours_xldRegressContoursXldRegressContoursXld.

Parallelization

Parameters

ContoursContoursContoursContoursContourscontours (input_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject

Input XLD contours.

UnionContoursUnionContoursUnionContoursUnionContoursUnionContoursunionContours (output_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject *

Output XLD contours.

MaxDistMaxDistMaxDistMaxDistMaxDistmaxDist (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum distance of the contours' endpoints.

Default value: 5.0

MaxDiffMaxDiffMaxDiffMaxDiffMaxDiffmaxDiff (input_control)  angle.rad HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum difference in direction.

Default value: 0.5

PercentPercentPercentPercentPercentpercent (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Weighting factor for the two selection criteria.

Default value: 50.0

ModeModeModeModeModemode (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Should parallel contours be taken into account?

Default value: 'noparallel' "noparallel" "noparallel" "noparallel" "noparallel" "noparallel"

List of values: 'every'"every""every""every""every""every", 'noparallel'"noparallel""noparallel""noparallel""noparallel""noparallel", 'paralleltoo'"paralleltoo""paralleltoo""paralleltoo""paralleltoo""paralleltoo"

IterationsIterationsIterationsIterationsIterationsiterations (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong) (BSTR / Hlong) (char* / Hlong)

Number of iterations or 'maximum'.

Default value: 'maximum' "maximum" "maximum" "maximum" "maximum" "maximum"

Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 'maximum'"maximum""maximum""maximum""maximum""maximum"

Typical range of values: 1 ≤ Iterations Iterations Iterations Iterations Iterations iterations ≤ 500 (lin)

Minimum increment: 1

Recommended increment: 1

Possible Predecessors

regress_contours_xldregress_contours_xldRegressContoursXldregress_contours_xldRegressContoursXldRegressContoursXld

Alternatives

union_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld, union_collinear_contours_ext_xldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldUnionCollinearContoursExtXld, union_cocircular_contours_xldunion_cocircular_contours_xldUnionCocircularContoursXldunion_cocircular_contours_xldUnionCocircularContoursXldUnionCocircularContoursXld, union_cotangential_contours_xldunion_cotangential_contours_xldUnionCotangentialContoursXldunion_cotangential_contours_xldUnionCotangentialContoursXldUnionCotangentialContoursXld, union_adjacent_contours_xldunion_adjacent_contours_xldUnionAdjacentContoursXldunion_adjacent_contours_xldUnionAdjacentContoursXldUnionAdjacentContoursXld

See also

fit_line_contour_xldfit_line_contour_xldFitLineContourXldfit_line_contour_xldFitLineContourXldFitLineContourXld, get_contour_xldget_contour_xldGetContourXldget_contour_xldGetContourXldGetContourXld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld, gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld, lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss, lines_facetlines_facetLinesFacetlines_facetLinesFacetLinesFacet, edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix, get_regress_params_xldget_regress_params_xldGetRegressParamsXldget_regress_params_xldGetRegressParamsXldGetRegressParamsXld, get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXld, query_contour_global_attribs_xldquery_contour_global_attribs_xldQueryContourGlobalAttribsXldquery_contour_global_attribs_xldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXld

Module

Foundation


ClassesClassesClassesClasses | | | | Operators