Skip to content

distance_rr_mindistance_rr_minDistanceRrMinDistanceRrMindistance_rr_mindistance_rr_minπŸ”—

Short descriptionπŸ”—

distance_rr_mindistance_rr_minDistanceRrMinDistanceRrMindistance_rr_mindistance_rr_min β€” Minimum distance between the contour pixels of two regions each.

SignatureπŸ”—

distance_rr_min( region Regions1, region Regions2, out real MinDistance, out point.y Row1, out point.x Column1, out point.y Row2, out point.x Column2 )distance_rr_min( Regions1, Regions2 : : : MinDistance, Row1, Column1, Row2, Column2 )void DistanceRrMin( const HObject& Regions1, const HObject& Regions2, HTuple* MinDistance, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2 )static void HOperatorSet.DistanceRrMin( HObject regions1, HObject regions2, out HTuple minDistance, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2 )def distance_rr_min( regions_1: HObject, regions_2: HObject ) -> Tuple[Sequence[float], Sequence[int], Sequence[int], Sequence[int], Sequence[int]]

def distance_rr_min_s( regions_1: HObject, regions_2: HObject ) -> Tuple[float, int, int, int, int]Herror distance_rr_min( const Hobject Regions1, const Hobject Regions2, double* MinDistance, Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2 )

Herror T_distance_rr_min( const Hobject Regions1, const Hobject Regions2, Htuple* MinDistance, Htuple* Row1, Htuple* Column1, Htuple* Row2, Htuple* Column2 )

HTuple HRegion::DistanceRrMin( const HRegion& Regions2, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2 ) const

double HRegion::DistanceRrMin( const HRegion& Regions2, Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2 ) const

HTuple HRegion.DistanceRrMin( HRegion regions2, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2 )

double HRegion.DistanceRrMin( HRegion regions2, out int row1, out int column1, out int row2, out int column2 )

DescriptionπŸ”—

The operator distance_rr_minDistanceRrMin calculates the minimum distance of pairs of regions. If several regions are passed in Regions1regions1regions_1 and Regions2regions2regions_2 the distance between the contour pixels of each i-th element is calculated and then forms the i-th entry in the output parameter MinDistanceminDistancemin_distance. The Euclidean distance is used. The parameters (Row1row1row_1, Column1column1column_1) andΒ (Row2row2row_2, Column2column2column_2) indicate the position on the contour of Regions1regions1regions_1 and Regions2regions2regions_2, respectively, that have the minimum distance.

The calculation is carried out by comparing all contour pixels (see get_region_contourGetRegionContour). This means in particular that holes in the regions are ignored. Furthermore, it is not checked whether one region lies completely within the other region. In this case, a minimum distance \(>\) 0 is returned. It is also not checked whether both regions contain a nonempty intersection. In the latter case, a minimum distance of 0 or \(>\) 0 can be returned, depending on whether the contours of the regions contain a common point or not.

AttentionπŸ”—

Both input parameters must contain the same number of regions. The regions must not be empty.

Execution informationπŸ”—

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

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

ParametersπŸ”—

Regions1regions1regions_1 (input_object) region(-array) β†’ objectobjectHObjectHRegionHObjectHobject

Regions to be examined.

Regions2regions2regions_2 (input_object) region(-array) β†’ objectobjectHObjectHRegionHObjectHobject

Regions to be examined.

MinDistanceminDistancemin_distance (output_control) real(-array) β†’ (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Minimum distance between contours of the regions.

Assertion: 0 <= MinDistance

Row1row1row_1 (output_control) point.y(-array) β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Line index on contour in Regions1regions1regions_1.

Column1column1column_1 (output_control) point.x(-array) β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Column index on contour in Regions1regions1regions_1.

Row2row2row_2 (output_control) point.y(-array) β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Line index on contour in Regions2regions2regions_2.

Column2column2column_2 (output_control) point.x(-array) β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Column index on contour in Regions2regions2regions_2.

ComplexityπŸ”—

If \(N1\),\(N2\) are the lengths of the contours the runtime complexity is \(O(N1 * N2)\).

ResultπŸ”—

The operator distance_rr_minDistanceRrMin returns the value 2 (H_MSG_TRUE) if the input is not empty. Otherwise an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

Alternatives

distance_rr_min_dilDistanceRrMinDil, dilation1Dilation1, intersectionIntersection

ModuleπŸ”—

Foundation