Operator Reference

union_straight_contours_histo_xldT_union_straight_contours_histo_xldUnionStraightContoursHistoXldUnionStraightContoursHistoXldunion_straight_contours_histo_xld (Operator)

union_straight_contours_histo_xldT_union_straight_contours_histo_xldUnionStraightContoursHistoXldUnionStraightContoursHistoXldunion_straight_contours_histo_xld — Compute the union of neighboring straight contours that have a similar distance from a given line.

Warning

union_straight_contours_histo_xldunion_straight_contours_histo_xldUnionStraightContoursHistoXldUnionStraightContoursHistoXldunion_straight_contours_histo_xld is obsolete and is only provided for reasons of backward compatibility. New applications should use the operators of the chapter 1D Measuring instead.

Signature

Herror T_union_straight_contours_histo_xld(const Hobject Contours, Hobject* UnionContours, Hobject* SelectedContours, const Htuple RefLineStartRow, const Htuple RefLineStartColumn, const Htuple RefLineEndRow, const Htuple RefLineEndColumn, const Htuple Width, const Htuple MaxWidth, const Htuple FilterSize, Htuple* HistoValues)

void UnionStraightContoursHistoXld(const HObject& Contours, HObject* UnionContours, HObject* SelectedContours, const HTuple& RefLineStartRow, const HTuple& RefLineStartColumn, const HTuple& RefLineEndRow, const HTuple& RefLineEndColumn, const HTuple& Width, const HTuple& MaxWidth, const HTuple& FilterSize, HTuple* HistoValues)

HXLDCont HXLDCont::UnionStraightContoursHistoXld(HXLDCont* SelectedContours, Hlong RefLineStartRow, Hlong RefLineStartColumn, Hlong RefLineEndRow, Hlong RefLineEndColumn, Hlong Width, Hlong MaxWidth, Hlong FilterSize, HTuple* HistoValues) const

def union_straight_contours_histo_xld(contours: HObject, ref_line_start_row: int, ref_line_start_column: int, ref_line_end_row: int, ref_line_end_column: int, width: int, max_width: int, filter_size: int) -> Tuple[HObject, HObject, Sequence[int]]

Description

union_straight_contours_histo_xldunion_straight_contours_histo_xldUnionStraightContoursHistoXldUnionStraightContoursHistoXldunion_straight_contours_histo_xld merges neighboring XLD contours ContoursContoursContourscontourscontours if certain criteria are fulfilled.

The maximum and minimum distances of the contours to a given reference line are calculated. From this distances a histogram is created. If the histogram should be smoothed, FilterSizeFilterSizeFilterSizefilterSizefilter_size must be greater than one. Afterwards, the resulting histogram is divided into ranges (from minima to minima). Contours which lie in the same range are concatenated to a new contour. If the width of the range is greater than MaxWidthMaxWidthMaxWidthmaxWidthmax_width, all contours in this range are ignored (removed). If a contour lies in two ranges or more it is ignored, too. If there are parallel contours, there is a risk of merging neighboring contours.

The parameters of the regression lines are calculated newly for merged contours.

The resulting contours cannot be displayed.

Attention

Before contours can be united by union_straight_contours_histo_xldunion_straight_contours_histo_xldUnionStraightContoursHistoXldUnionStraightContoursHistoXldunion_straight_contours_histo_xld, the parameters of the regression lines to the contours must be calculated by calling regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldregress_contours_xld. Note further that already closed contours are not considered for a union anymore.

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

ContoursContoursContourscontourscontours (input_object)  xld_cont-array objectHXLDContHObjectHObjectHobject

Input XLD contours.

UnionContoursUnionContoursUnionContoursunionContoursunion_contours (output_object)  xld_cont-array objectHXLDContHObjectHObjectHobject *

Output XLD contours.

SelectedContoursSelectedContoursSelectedContoursselectedContoursselected_contours (output_object)  xld_cont-array objectHXLDContHObjectHObjectHobject *

Output XLD contours.

RefLineStartRowRefLineStartRowRefLineStartRowrefLineStartRowref_line_start_row (input_control)  line.begin.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

y coordinate of the starting point of the reference line.

Default: 0

RefLineStartColumnRefLineStartColumnRefLineStartColumnrefLineStartColumnref_line_start_column (input_control)  line.begin.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

x coordinate of the starting point of the reference line.

Default: 0

RefLineEndRowRefLineEndRowRefLineEndRowrefLineEndRowref_line_end_row (input_control)  line.end.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

y coordinate of the endpoint of the reference line.

Default: 0

RefLineEndColumnRefLineEndColumnRefLineEndColumnrefLineEndColumnref_line_end_column (input_control)  line.end.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

x coordinate of the endpoint of the reference line.

Default: 0

WidthWidthWidthwidthwidth (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximum distance.

Default: 1

MaxWidthMaxWidthMaxWidthmaxWidthmax_width (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximum width between two minima.

Default: 1

FilterSizeFilterSizeFilterSizefilterSizefilter_size (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Size of smoothing filter

Default: 1

Value range: 1 ≤ FilterSize FilterSize FilterSize filterSize filter_size ≤ 63

HistoValuesHistoValuesHistoValueshistoValueshisto_values (output_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Output values of histogram.

Module

Foundation