distance_rr_mindistance_rr_minDistanceRrMinDistanceRrMindistance_rr_min (Operator)
Name
distance_rr_mindistance_rr_minDistanceRrMinDistanceRrMindistance_rr_min
— Minimum distance between the contour pixels of two regions each.
Signature
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)
void DistanceRrMin(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
static void HOperatorSet.DistanceRrMin(HObject regions1, HObject regions2, out HTuple minDistance, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2)
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)
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]
Description
The operator distance_rr_mindistance_rr_minDistanceRrMinDistanceRrMindistance_rr_min
calculates the minimum distance
of pairs of regions. If several regions are passed in
Regions1Regions1Regions1regions1regions_1
and Regions2Regions2Regions2regions2regions_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 MinDistanceMinDistanceMinDistanceminDistancemin_distance
. The
Euclidean distance is used. The parameters (Row1Row1Row1row1row_1
,
Column1Column1Column1column1column_1
) and (Row2Row2Row2row2row_2
, Column2Column2Column2column2column_2
) indicate
the position on the contour of Regions1Regions1Regions1regions1regions_1
and
Regions2Regions2Regions2regions2regions_2
, respectively, that have the minimum distance.
The calculation is carried out by comparing all contour pixels (see
get_region_contourget_region_contourGetRegionContourGetRegionContourget_region_contour
). 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
- 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
Regions1Regions1Regions1regions1regions_1
(input_object) region(-array) →
objectHRegionHObjectHObjectHobject
Regions to be examined.
Regions2Regions2Regions2regions2regions_2
(input_object) region(-array) →
objectHRegionHObjectHObjectHobject
Regions to be examined.
MinDistanceMinDistanceMinDistanceminDistancemin_distance
(output_control) real(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Minimum distance between contours of the regions.
Assertion:
0 <= MinDistance
Complexity
If N1,N2 are the lengths of the contours the runtime
complexity is O(N1 * N2).
Result
The operator distance_rr_mindistance_rr_minDistanceRrMinDistanceRrMindistance_rr_min
returns the value 2 (
H_MSG_TRUE)
if the
input is not empty. Otherwise an exception is raised.
Possible Predecessors
thresholdthresholdThresholdThresholdthreshold
,
regiongrowingregiongrowingRegiongrowingRegiongrowingregiongrowing
,
connectionconnectionConnectionConnectionconnection
Alternatives
distance_rr_min_dildistance_rr_min_dilDistanceRrMinDilDistanceRrMinDildistance_rr_min_dil
,
dilation1dilation1Dilation1Dilation1dilation1
,
intersectionintersectionIntersectionIntersectionintersection
Module
Foundation