union_straight_contours_xld union_straight_contours_xld UnionStraightContoursXld UnionStraightContoursXld union_straight_contours_xld (Operator)
union_straight_contours_xld union_straight_contours_xld UnionStraightContoursXld UnionStraightContoursXld union_straight_contours_xld
— Compute the union of neighboring straight contours that have a similar
direction.
Signature
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 )
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
HXLDCont HXLDCont ::UnionStraightContoursXld (double MaxDist , double MaxDiff , double Percent , const wchar_t* Mode , const wchar_t* Iterations ) const
(
Windows only)
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_xld union_straight_contours_xld UnionStraightContoursXld UnionStraightContoursXld union_straight_contours_xld
merges neighboring XLD contours
Contours Contours Contours contours contours
if certain criteria are fulfilled. At each
iteration, at most two contours that fulfill the given criteria are
merged. The parameter Iterations Iterations Iterations iterations iterations
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
MaxDist MaxDist MaxDist maxDist max_dist
, and if the difference in direction (i.e., the
regression lines' direction) is smaller than MaxDiff MaxDiff MaxDiff maxDiff max_diff
(radians).
If only one of the criteria is fulfilled, the decision on merging can
be influenced by the weighting factor Percent Percent Percent percent percent
, 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 Percent Percent Percent percent percent
, while the directional
difference is weighted by 100 - Percent Percent Percent percent percent
.
This means that two contours are merged if they fulfill the following
condition:
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
MaxDist MaxDist MaxDist maxDist max_dist
= 4.0 and MaxDiff MaxDiff MaxDiff maxDiff max_diff
= 0.625 ), both
values differ from the limits by 25%. By choosing
Percent Percent Percent percent percent
= 60 %, the larger end point distance is weighted
more than the smaller directional difference, and thus the contours
are not merged. Contrary, if Percent Percent Percent percent percent
= 40 % is chosen,
the contours are merged.
For Percent Percent Percent percent percent
= 100 %, only the end point distance is taken
into account, while for Percent Percent Percent percent percent
= 0 % only the difference
of direction is used. If Percent Percent Percent percent percent
= 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, Mode Mode Mode mode mode
=
'noparallel' "noparallel" "noparallel" "noparallel" "noparallel" has to be chosen, while otherwise Mode Mode Mode mode mode
=
'paralleltoo' "paralleltoo" "paralleltoo" "paralleltoo" "paralleltoo" suffices. For Mode Mode Mode mode mode
= 'every' "every" "every" "every" "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 contours can be united by union_straight_contours_xld union_straight_contours_xld UnionStraightContoursXld UnionStraightContoursXld union_straight_contours_xld
,
the parameters of the regression lines to the contours must be calculated
by calling regress_contours_xld regress_contours_xld RegressContoursXld RegressContoursXld regress_contours_xld
.
Furthermore, note that union_straight_contours_xld union_straight_contours_xld UnionStraightContoursXld UnionStraightContoursXld union_straight_contours_xld
can not compute
the union of contours with different contour point attributes.
This can be the case if different operators are used for the contour
extraction (e.g., lines_gauss lines_gauss LinesGauss LinesGauss lines_gauss
and lines_facet lines_facet LinesFacet LinesFacet lines_facet
). For information
on the contour attributes and when they are defined, see the
respective operator reference. You can query the point attributes of your
contour using query_contour_attribs_xld query_contour_attribs_xld QueryContourAttribsXld QueryContourAttribsXld query_contour_attribs_xld
.
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 Contours Contours contours contours
(input_object) xld_cont-array →
object HXLDCont HObject HObject Hobject
Input XLD contours.
UnionContours UnionContours UnionContours unionContours union_contours
(output_object) xld_cont-array →
object HXLDCont HObject HObject Hobject *
Output XLD contours.
MaxDist MaxDist MaxDist maxDist max_dist
(input_control) real →
HTuple float HTuple Htuple (real) (double ) (double ) (double )
Maximum distance of the contours' endpoints.
Default:
5.0
MaxDiff MaxDiff MaxDiff maxDiff max_diff
(input_control) angle.rad →
HTuple float HTuple Htuple (real) (double ) (double ) (double )
Maximum difference in direction.
Default:
0.5
Percent Percent Percent percent percent
(input_control) real →
HTuple float HTuple Htuple (real) (double ) (double ) (double )
Weighting factor for the two selection criteria.
Default:
50.0
Mode Mode Mode mode mode
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Should parallel contours be taken into account?
Default:
'noparallel'
"noparallel"
"noparallel"
"noparallel"
"noparallel"
List of values:
'every' "every" "every" "every" "every" , 'noparallel' "noparallel" "noparallel" "noparallel" "noparallel" , 'paralleltoo' "paralleltoo" "paralleltoo" "paralleltoo" "paralleltoo"
Iterations Iterations Iterations iterations iterations
(input_control) string →
HTuple Union[int, str] HTuple Htuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)
Number of iterations or 'maximum'.
Default:
'maximum'
"maximum"
"maximum"
"maximum"
"maximum"
Suggested values:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 'maximum' "maximum" "maximum" "maximum" "maximum"
Value range:
1
≤
Iterations
Iterations
Iterations
iterations
iterations
≤
500
(lin)
Minimum increment:
1
Recommended increment:
1
Possible Predecessors
regress_contours_xld regress_contours_xld RegressContoursXld RegressContoursXld regress_contours_xld
Alternatives
union_collinear_contours_xld union_collinear_contours_xld UnionCollinearContoursXld UnionCollinearContoursXld union_collinear_contours_xld
,
union_collinear_contours_ext_xld union_collinear_contours_ext_xld UnionCollinearContoursExtXld UnionCollinearContoursExtXld union_collinear_contours_ext_xld
,
union_cocircular_contours_xld union_cocircular_contours_xld UnionCocircularContoursXld UnionCocircularContoursXld union_cocircular_contours_xld
,
union_cotangential_contours_xld union_cotangential_contours_xld UnionCotangentialContoursXld UnionCotangentialContoursXld union_cotangential_contours_xld
,
union_adjacent_contours_xld union_adjacent_contours_xld UnionAdjacentContoursXld UnionAdjacentContoursXld union_adjacent_contours_xld
See also
fit_line_contour_xld fit_line_contour_xld FitLineContourXld FitLineContourXld fit_line_contour_xld
,
get_contour_xld get_contour_xld GetContourXld GetContourXld get_contour_xld
,
get_contour_attrib_xld get_contour_attrib_xld GetContourAttribXld GetContourAttribXld get_contour_attrib_xld
,
gen_contours_skeleton_xld gen_contours_skeleton_xld GenContoursSkeletonXld GenContoursSkeletonXld gen_contours_skeleton_xld
,
lines_gauss lines_gauss LinesGauss LinesGauss lines_gauss
,
lines_facet lines_facet LinesFacet LinesFacet lines_facet
,
edges_sub_pix edges_sub_pix EdgesSubPix EdgesSubPix edges_sub_pix
,
get_regress_params_xld get_regress_params_xld GetRegressParamsXld GetRegressParamsXld get_regress_params_xld
,
get_contour_global_attrib_xld get_contour_global_attrib_xld GetContourGlobalAttribXld GetContourGlobalAttribXld get_contour_global_attrib_xld
,
query_contour_global_attribs_xld query_contour_global_attribs_xld QueryContourGlobalAttribsXld QueryContourGlobalAttribsXld query_contour_global_attribs_xld
Module
Foundation