Skip to content

gen_region_runsgen_region_runsGenRegionRunsGenRegionRunsgen_region_runsgen_region_runsπŸ”—

Short descriptionπŸ”—

gen_region_runsgen_region_runsGenRegionRunsGenRegionRunsgen_region_runsgen_region_runs β€” Create a region from a runlength coding.

SignatureπŸ”—

gen_region_runs( out region Region, chord.y Row, chord.x1 ColumnBegin, chord.x2 ColumnEnd )gen_region_runs( : Region : Row, ColumnBegin, ColumnEnd : )void GenRegionRuns( HObject* Region, const HTuple& Row, const HTuple& ColumnBegin, const HTuple& ColumnEnd )static void HOperatorSet.GenRegionRuns( out HObject region, HTuple row, HTuple columnBegin, HTuple columnEnd )def gen_region_runs( row: MaybeSequence[int], column_begin: MaybeSequence[int], column_end: MaybeSequence[int] ) -> HObject

Herror gen_region_runs( Hobject* Region, const Hlong Row, const Hlong ColumnBegin, const Hlong ColumnEnd )

Herror T_gen_region_runs( Hobject* Region, const Htuple Row, const Htuple ColumnBegin, const Htuple ColumnEnd )

void HRegion::GenRegionRuns( const HTuple& Row, const HTuple& ColumnBegin, const HTuple& ColumnEnd )

void HRegion::GenRegionRuns( Hlong Row, Hlong ColumnBegin, Hlong ColumnEnd )

void HRegion.GenRegionRuns( HTuple row, HTuple columnBegin, HTuple columnEnd )

void HRegion.GenRegionRuns( int row, int columnBegin, int columnEnd )

DescriptionπŸ”—

The operator gen_region_runsGenRegionRuns creates a region described by the input runlength structure. The runlength representation is created by examining a region line by line with ascending line number (= from β€œtop” to β€œbottom”). Every line runs through from left to right (ascending column number). All starting and ending points being stored by region segments (=runs). Thus a region can be described by a sequence of runs, a run being defined by line number as well as starting and ending points (column number).

The storing is fastest when the runs are sorted. The order is as follows:

\[\begin{eqnarray*} (l_{1},b_{1},e_{1}) \le (l_{2},b_{2},e_{2}) := (l_{1} < l_{2}) \hspace{2mm} \vee \hspace{2mm}(l_{1} = l_{2}) \wedge (b_{1} \le b_{2}) \end{eqnarray*}\]

.

AttentionπŸ”—

For runtime reasons, it is not checked whether the restriction \(\textrm{ColumnEnd} >= \textrm{ColumnBegin}\) is fulfilled. Note that if this restriction is violated, subsequent operations will likely lead to errors or unexpected behavior.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

ParametersπŸ”—

Regionregionregion (output_object) region β†’ objectobjectHObjectHRegionHObjectHobject *

Created region.

Rowrowrow (input_control) chord.y(-array) β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Lines of the runs.

Default: 100100
Suggested values: 0, 50, 100, 200, 300, 5000, 50, 100, 200, 300, 500
Value range: Row (lin)
Minimum increment: 1
Recommended increment: 10

ColumnBegincolumnBegincolumn_begin (input_control) chord.x1(-array) β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Columns of the starting points of the runs.

Number of elements: ColumnBegin == Row
Default: 5050
Suggested values: 0, 50, 100, 200, 300, 5000, 50, 100, 200, 300, 500
Value range: ColumnBegin (lin)
Minimum increment: 1
Recommended increment: 10

ColumnEndcolumnEndcolumn_end (input_control) chord.x2(-array) β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Columns of the ending points of the runs.

Number of elements: ColumnEnd == Row
Default: 200200
Suggested values: 50, 100, 200, 300, 50050, 100, 200, 300, 500
Value range: ColumnEnd (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: ColumnEnd >= ColumnBegin

ComplexityπŸ”—

\(F\) shall be the number of pixels. If the pixels are sorted in ascending order the runtime complexity is: \(O(F)\), otherwise it is \(O(\log(F)*F)\).

ResultπŸ”—

If the data is correct the operator gen_region_runsGenRegionRuns returns the value 2 (H_MSG_TRUE), otherwise an exception is raised. The clipping according to the global image size is set via the operator set_system('clip_region',<'true'/'false'>). If an empty region is created (by the clipping or by an empty input) the operator set_system('store_empty_region',<'true'/'false'>) determines whether the region is returned or an empty object tuple.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

get_region_runsGetRegionRuns

Alternatives

gen_region_pointsGenRegionPoints, gen_region_polygonGenRegionPolygon, gen_region_lineGenRegionLine, gen_region_polygon_filledGenRegionPolygonFilled

See also

reduce_domainReduceDomain

ModuleπŸ”—

Foundation