Skip to content

diameter_regionDiameterRegionDiameterRegiondiameter_regiondiameter_region🔗

Short description🔗

diameter_regionDiameterRegionDiameterRegiondiameter_regiondiameter_region — Maximal distance between two boundary points of a region.

Signature🔗

diameter_region( region Regions, out line.begin.y Row1, out line.begin.x Column1, out line.end.y Row2, out line.end.x Column2, out number Diameter )void DiameterRegion( const HObject& Regions, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2, HTuple* Diameter )static void HOperatorSet.DiameterRegion( HObject regions, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2, out HTuple diameter )def diameter_region( regions: HObject ) -> Tuple[Sequence[int], Sequence[int], Sequence[int], Sequence[int], Sequence[float]]

def diameter_region_s( regions: HObject ) -> Tuple[int, int, int, int, float]Herror diameter_region( const Hobject Regions, Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2, double* Diameter )

Herror T_diameter_region( const Hobject Regions, Htuple* Row1, Htuple* Column1, Htuple* Row2, Htuple* Column2, Htuple* Diameter )

void HRegion::DiameterRegion( HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2, HTuple* Diameter ) const

void HRegion::DiameterRegion( Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2, double* Diameter ) const

void HRegion.DiameterRegion( out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2, out HTuple diameter )

void HRegion.DiameterRegion( out int row1, out int column1, out int row2, out int column2, out double diameter )

Description🔗

The operator diameter_regionDiameterRegion calculates the maximal distance between two boundary points of a region. The coordinates of these two extremes and the distance between them will be returned.

In the documentation of this chapter (Regions / Features), you can find an image illustrating regions which vary in their diameter.

Attention🔗

If the region is empty, the results of Row1row1row_1, Column1column1column_1, Row2row2row_2 and Column2column2column_2 (all of them = 0) may lead to confusion.

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 tuple level.

Parameters🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Regions to be examined.

Row1row1row_1 (output_control) line.begin.y(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Row index of the first extreme point.

Column1column1column_1 (output_control) line.begin.x(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Column index of the first extreme point.

Row2row2row_2 (output_control) line.end.y(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Row index of the second extreme point.

Column2column2column_2 (output_control) line.end.x(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Column index of the second extreme point.

Diameterdiameterdiameter (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Distance of the two extreme points.

Complexity🔗

If \(F\) is the area of a region, the runtime complexity amounts to \(O(\sqrt{F})\) on average.

Result🔗

The operator diameter_regionDiameterRegion returns the value 2 (H_MSG_TRUE), if the input is not empty. The reaction to empty input (no input regions are available) may be determined with the help of the operator set_system('no_object_result',<Result>). The reaction concerning an empty region (region is the empty set) will be determined by the operator set_system('empty_region_result',<Result>). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection, runlength_featuresRunlengthFeatures

Possible successors

disp_lineDispLine

Alternatives

smallest_rectangle2SmallestRectangle2

Module🔗

Foundation