ClassesClassesClassesClasses | | | | Operators

union_collinear_contours_ext_xldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldUnionCollinearContoursExtXld (Operator)

Name

union_collinear_contours_ext_xldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldUnionCollinearContoursExtXld — Compute the union of collinear contours (operator with extended functionality).

Signature

union_collinear_contours_ext_xld(Contours : UnionContours : MaxDistAbs, MaxDistRel, MaxShift, MaxAngle, MaxOverlap, MaxRegrError, MaxCosts, WeightDist, WeightShift, WeightAngle, WeightLink, WeightRegr, Mode : )

Herror union_collinear_contours_ext_xld(const Hobject Contours, Hobject* UnionContours, double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, double MaxOverlap, double MaxRegrError, double MaxCosts, double WeightDist, double WeightShift, double WeightAngle, double WeightLink, double WeightRegr, const char* Mode)

Herror T_union_collinear_contours_ext_xld(const Hobject Contours, Hobject* UnionContours, const Htuple MaxDistAbs, const Htuple MaxDistRel, const Htuple MaxShift, const Htuple MaxAngle, const Htuple MaxOverlap, const Htuple MaxRegrError, const Htuple MaxCosts, const Htuple WeightDist, const Htuple WeightShift, const Htuple WeightAngle, const Htuple WeightLink, const Htuple WeightRegr, const Htuple Mode)

Herror union_collinear_contours_ext_xld(Hobject Contours, Hobject* UnionContours, const HTuple& MaxDistAbs, const HTuple& MaxDistRel, const HTuple& MaxShift, const HTuple& MaxAngle, const HTuple& MaxOverlap, const HTuple& MaxRegrError, const HTuple& MaxCosts, const HTuple& WeightDist, const HTuple& WeightShift, const HTuple& WeightAngle, const HTuple& WeightLink, const HTuple& WeightRegr, const HTuple& Mode)

HXLDContArray HXLDContArray::UnionCollinearContoursExtXld(const HTuple& MaxDistAbs, const HTuple& MaxDistRel, const HTuple& MaxShift, const HTuple& MaxAngle, const HTuple& MaxOverlap, const HTuple& MaxRegrError, const HTuple& MaxCosts, const HTuple& WeightDist, const HTuple& WeightShift, const HTuple& WeightAngle, const HTuple& WeightLink, const HTuple& WeightRegr, const HTuple& Mode) const

void UnionCollinearContoursExtXld(const HObject& Contours, HObject* UnionContours, const HTuple& MaxDistAbs, const HTuple& MaxDistRel, const HTuple& MaxShift, const HTuple& MaxAngle, const HTuple& MaxOverlap, const HTuple& MaxRegrError, const HTuple& MaxCosts, const HTuple& WeightDist, const HTuple& WeightShift, const HTuple& WeightAngle, const HTuple& WeightLink, const HTuple& WeightRegr, const HTuple& Mode)

HXLDCont HXLDCont::UnionCollinearContoursExtXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, double MaxOverlap, double MaxRegrError, double MaxCosts, double WeightDist, double WeightShift, double WeightAngle, double WeightLink, double WeightRegr, const HString& Mode) const

HXLDCont HXLDCont::UnionCollinearContoursExtXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, double MaxOverlap, double MaxRegrError, double MaxCosts, double WeightDist, double WeightShift, double WeightAngle, double WeightLink, double WeightRegr, const char* Mode) const

void HOperatorSetX.UnionCollinearContoursExtXld(
[in] IHUntypedObjectX* Contours, [out] IHUntypedObjectX*UnionContours, [in] VARIANT MaxDistAbs, [in] VARIANT MaxDistRel, [in] VARIANT MaxShift, [in] VARIANT MaxAngle, [in] VARIANT MaxOverlap, [in] VARIANT MaxRegrError, [in] VARIANT MaxCosts, [in] VARIANT WeightDist, [in] VARIANT WeightShift, [in] VARIANT WeightAngle, [in] VARIANT WeightLink, [in] VARIANT WeightRegr, [in] VARIANT Mode)

IHXLDContX* HXLDContX.UnionCollinearContoursExtXld(
[in] double MaxDistAbs, [in] double MaxDistRel, [in] double MaxShift, [in] double MaxAngle, [in] double MaxOverlap, [in] double MaxRegrError, [in] double MaxCosts, [in] double WeightDist, [in] double WeightShift, [in] double WeightAngle, [in] double WeightLink, [in] double WeightRegr, [in] BSTR Mode)

static void HOperatorSet.UnionCollinearContoursExtXld(HObject contours, out HObject unionContours, HTuple maxDistAbs, HTuple maxDistRel, HTuple maxShift, HTuple maxAngle, HTuple maxOverlap, HTuple maxRegrError, HTuple maxCosts, HTuple weightDist, HTuple weightShift, HTuple weightAngle, HTuple weightLink, HTuple weightRegr, HTuple mode)

HXLDCont HXLDCont.UnionCollinearContoursExtXld(double maxDistAbs, double maxDistRel, double maxShift, double maxAngle, double maxOverlap, double maxRegrError, double maxCosts, double weightDist, double weightShift, double weightAngle, double weightLink, double weightRegr, string mode)

Description

Like union_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld, the operator union_collinear_contours_ext_xldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldUnionCollinearContoursExtXld detects all the collinear contours within the input array containing straight contours (ContoursContoursContoursContoursContourscontours) and returns the results in UnionContoursUnionContoursUnionContoursUnionContoursUnionContoursunionContours. The basic behavior is identical to the operator union_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld and was described there. union_collinear_contours_ext_xldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldUnionCollinearContoursExtXld, however, provides several additional parameters to control the process of contour unification more precisely.

The parameters MaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsmaxDistAbs, MaxDistRelMaxDistRelMaxDistRelMaxDistRelMaxDistRelmaxDistRel, MaxShiftMaxShiftMaxShiftMaxShiftMaxShiftmaxShift, and MaxAngleMaxAngleMaxAngleMaxAngleMaxAnglemaxAngle define, as described for the operator union_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld, the maximum distances between the two contours in the direction of the regression line and perpendicular to it as well as the maximum angle difference between the two contours.

In addition, the parameter MaxOverlapMaxOverlapMaxOverlapMaxOverlapMaxOverlapmaxOverlap allows to define an overlap between two contours, in order to connect contours which slightly overlap. Internally, the operator assures -- irrespective of the passed value for MaxOverlapMaxOverlapMaxOverlapMaxOverlapMaxOverlapmaxOverlap -- that the overlap is not bigger than a third of the length of both contours.

The parameter MaxRegrErrorMaxRegrErrorMaxRegrErrorMaxRegrErrorMaxRegrErrormaxRegrError is not used in the moment. Its aim is to assure that after the unification of two contours, the resulting contour does not deviate too much from its regression line. This parameter is by default switched off (-1), because of its high time consumption and because of the fact that it is normally not necessary. In some cases, however, result contours may be created with points diverging to much from the regression line (winding input contours, shift and angle differences close to the -- quite high adjusted -- thresholds, recursive unification of a lot of small contours).

With the help of the parameter MaxCostsMaxCostsMaxCostsMaxCostsMaxCostsmaxCosts it is possible to limit the maximum costs for connecting two contours. So, not only contour pairs with one value beyond a certain threshold may be excluded from unification, but also contour pairs where all values are quite close to the limits. The costs are always normalized at a value between 0 and 1, where 1 means that all values exactly meet the threshold.

The influence of the different values on the total costs is adjusted by passing appropriate weights with the parameters WeightDistWeightDistWeightDistWeightDistWeightDistweightDist, WeightShiftWeightShiftWeightShiftWeightShiftWeightShiftweightShift, WeightAngleWeightAngleWeightAngleWeightAngleWeightAngleweightAngle, WeightLinkWeightLinkWeightLinkWeightLinkWeightLinkweightLink, and WeightRegrWeightRegrWeightRegrWeightRegrWeightRegrweightRegr. Any positive number can be choosen for these weights, the resulting costs are always automatically normalized to fit the range from 0 to 1. The parameter WeightRegrWeightRegrWeightRegrWeightRegrWeightRegrweightRegr is not used.

The parameter ModeModeModeModeModemode controls -- as for union_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld -- how to handle the attributes of the input contours.

Parallelization

Parameters

ContoursContoursContoursContoursContourscontours (input_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject

Input XLD contours.

UnionContoursUnionContoursUnionContoursUnionContoursUnionContoursunionContours (output_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject *

Output XLD contours.

MaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsmaxDistAbs (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum distance of the contours' end points in the direction of the reference regression line.

Default value: 10.0

Typical range of values: 0.0 ≤ MaxDistAbs MaxDistAbs MaxDistAbs MaxDistAbs MaxDistAbs maxDistAbs

MaxDistRelMaxDistRelMaxDistRelMaxDistRelMaxDistRelmaxDistRel (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum distance of the contours' end points in the direction of the reference regression line in relation to the length of the contour which is to be elongated.

Default value: 1.0

Typical range of values: 0.0 ≤ MaxDistRel MaxDistRel MaxDistRel MaxDistRel MaxDistRel maxDistRel

MaxShiftMaxShiftMaxShiftMaxShiftMaxShiftmaxShift (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum distance of the contour from the reference regression line (i.e., perpendicular to the line).

Default value: 2.0

Typical range of values: 0.0 ≤ MaxShift MaxShift MaxShift MaxShift MaxShift maxShift

MaxAngleMaxAngleMaxAngleMaxAngleMaxAnglemaxAngle (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum angle difference between the two contours.

Default value: 0.1

Typical range of values: 0.0 ≤ MaxAngle MaxAngle MaxAngle MaxAngle MaxAngle maxAngle ≤ 0.78539816339

MaxOverlapMaxOverlapMaxOverlapMaxOverlapMaxOverlapmaxOverlap (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum range of the overlap.

Default value: 0.0

Typical range of values: 0.0 ≤ MaxOverlap MaxOverlap MaxOverlap MaxOverlap MaxOverlap maxOverlap

MaxRegrErrorMaxRegrErrorMaxRegrErrorMaxRegrErrorMaxRegrErrormaxRegrError (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum regression error of the resulting contours (NOT USED).

Default value: -1.0

MaxCostsMaxCostsMaxCostsMaxCostsMaxCostsmaxCosts (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Threshold for reducing the total costs of unification.

Default value: 1.0

Typical range of values: 0.0 ≤ MaxCosts MaxCosts MaxCosts MaxCosts MaxCosts maxCosts

WeightDistWeightDistWeightDistWeightDistWeightDistweightDist (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Influence of the distance in the line direction on the total costs.

Default value: 1.0

Typical range of values: 0.0 ≤ WeightDist WeightDist WeightDist WeightDist WeightDist weightDist

WeightShiftWeightShiftWeightShiftWeightShiftWeightShiftweightShift (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Influence of the distance from the regression line on the total costs.

Default value: 1.0

Typical range of values: 0.0 ≤ WeightShift WeightShift WeightShift WeightShift WeightShift weightShift

WeightAngleWeightAngleWeightAngleWeightAngleWeightAngleweightAngle (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Influence of the angle difference on the total costs.

Default value: 1.0

Typical range of values: 0.0 ≤ WeightAngle WeightAngle WeightAngle WeightAngle WeightAngle weightAngle

WeightLinkWeightLinkWeightLinkWeightLinkWeightLinkweightLink (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Influence of the line disturbance by the linking segment (overlap and angle difference) on the total costs.

Default value: 1.0

Typical range of values: 0.0 ≤ WeightLink WeightLink WeightLink WeightLink WeightLink weightLink

WeightRegrWeightRegrWeightRegrWeightRegrWeightRegrweightRegr (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Influence of the regression error on the total costs (NOT USED).

Default value: 0.0

Typical range of values: 0.0 ≤ WeightRegr WeightRegr WeightRegr WeightRegr WeightRegr weightRegr

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

Mode describing the treatment of the contours' attributes

Default value: 'attr_keep' "attr_keep" "attr_keep" "attr_keep" "attr_keep" "attr_keep"

List of values: 'attr_forget'"attr_forget""attr_forget""attr_forget""attr_forget""attr_forget", 'attr_keep'"attr_keep""attr_keep""attr_keep""attr_keep""attr_keep"

Possible Predecessors

split_contours_xldsplit_contours_xldSplitContoursXldsplit_contours_xldSplitContoursXldSplitContoursXld, select_contours_xldselect_contours_xldSelectContoursXldselect_contours_xldSelectContoursXldSelectContoursXld

Alternatives

union_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld, 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, union_straight_contours_xldunion_straight_contours_xldUnionStraightContoursXldunion_straight_contours_xldUnionStraightContoursXldUnionStraightContoursXld

See also

edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix, threshold_sub_pixthreshold_sub_pixThresholdSubPixthreshold_sub_pixThresholdSubPixThresholdSubPix, gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld, split_contours_xldsplit_contours_xldSplitContoursXldsplit_contours_xldSplitContoursXldSplitContoursXld, select_contours_xldselect_contours_xldSelectContoursXldselect_contours_xldSelectContoursXldSelectContoursXld, get_contour_xldget_contour_xldGetContourXldget_contour_xldGetContourXldGetContourXld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld

Module

Foundation


ClassesClassesClassesClasses | | | | Operators