union_collinear_contours_ext_xldπ
Short descriptionπ
union_collinear_contours_ext_xld β Compute the union of collinear contours
(operator with extended functionality).
Signatureπ
union_collinear_contours_ext_xld( xld_cont Contours, out xld_cont UnionContours, real MaxDistAbs, real MaxDistRel, real MaxShift, real MaxAngle, real MaxOverlap, real MaxRegrError, real MaxCosts, real WeightDist, real WeightShift, real WeightAngle, real WeightLink, real WeightRegr, string Mode )
Descriptionπ
Like union_collinear_contours_xld, the operator
union_collinear_contours_ext_xld detects all the
collinear contours within the input array containing straight
contours (Contours) and returns the results in
UnionContours.
The basic behavior is identical to the operator
union_collinear_contours_xld and is described there.
union_collinear_contours_ext_xld, however, provides several
additional parameters to control the process of contour unification
more precisely.
Parameters
The parameters MaxDistAbs, MaxDistRel,
MaxShift, and MaxAngle operate as described for
the operator union_collinear_contours_xld.
-
In addition, the parameter
MaxOverlapallows to define an overlap between two contours, in order to connect contours which slightly overlap. Internally, the operator assures β irrespective of the passed value forMaxOverlapβ that the overlap is not bigger than a third of the length of both contours.\(min(a,b) \leq \textrm{MaxOverlap}\)
-
The parameter
MaxRegrErroris not used at 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
MaxCostsit 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. -
WeightDist,WeightShift,WeightAngle,WeightLink, andWeightRegrThe influence of the different values on the total costs is adjusted by passing appropriate weights with the parameters
WeightDist,WeightShift,WeightAngle,WeightLink,WeightRegr. Any positive number can be chosen for these weights, the resulting costs are always automatically normalized to fit the range from 0 to 1. The parameterWeightRegris not used. -
The parameter
Modecontrols β as forunion_collinear_contours_xldβ how to handle the attributes of the input contours.
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π
Contours (input_object) xld_cont-array β object
Input XLD contours.
UnionContours (output_object) xld_cont-array β object
Output XLD contours.
MaxDistAbs (input_control) real β (real)
Maximum distance of the contoursβ end points in the direction of the reference regression line.
Default: 10.0
Value range: 0.0 β€ MaxDistAbs
MaxDistRel (input_control) real β (real)
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: 1.0
Value range: 0.0 β€ MaxDistRel
MaxShift (input_control) real β (real)
Maximum distance of the contour from the reference regression line (i.e., perpendicular to the line).
Default: 2.0
Value range: 0.0 β€ MaxShift
MaxAngle (input_control) real β (real)
Maximum angle difference between the two contours.
Default: 0.1
Value range: 0.0 β€ MaxAngle β€ 0.78539816339
MaxOverlap (input_control) real β (real)
Maximum range of the overlap.
Default: 0.0
Value range: 0.0 β€ MaxOverlap
MaxRegrError (input_control) real β (real)
Maximum regression error of the resulting contours (NOT USED).
Default: -1.0
MaxCosts (input_control) real β (real)
Threshold for reducing the total costs of unification.
Default: 1.0
Value range: 0.0 β€ MaxCosts
WeightDist (input_control) real β (real)
Influence of the distance in the line direction on the total costs.
Default: 1.0
Value range: 0.0 β€ WeightDist
WeightShift (input_control) real β (real)
Influence of the distance from the regression line on the total costs.
Default: 1.0
Value range: 0.0 β€ WeightShift
WeightAngle (input_control) real β (real)
Influence of the angle difference on the total costs.
Default: 1.0
Value range: 0.0 β€ WeightAngle
WeightLink (input_control) real β (real)
Influence of the line disturbance by the linking segment (overlap and angle difference) on the total costs.
Default: 1.0
Value range: 0.0 β€ WeightLink
WeightRegr (input_control) real β (real)
Influence of the regression error on the total costs (NOT USED).
Default: 0.0
Value range: 0.0 β€ WeightRegr
Mode (input_control) string β (string)
Mode describing the treatment of the contoursβ attributes
Default: 'attr_keep'
List of values: 'attr_forget', 'attr_keep'
Combinations with other operatorsπ
Combinations
Possible predecessors
split_contours_xld, select_contours_xld
Alternatives
union_collinear_contours_xld, union_cocircular_contours_xld, union_cotangential_contours_xld, union_adjacent_contours_xld, union_straight_contours_xld
See also
edges_sub_pix, threshold_sub_pix, gen_polygons_xld, split_contours_xld, select_contours_xld, get_contour_xld, get_contour_attrib_xld
Moduleπ
Foundation