distance_rr_min ( Regions1, Regions2 : : : MinDistance, Row1, Column1, Row2, Column2 )

Minimum distance between the contour pixels of two regions each.

The operator distance_rr_min calculates the minimum distance of pairs of regions. If several regions are passed in Regions1 and Regions2 the distance between the contour pixels of each i-th element is calculated and then forms the i-th entry in the output parameter MinDistance. The calculation is carried out by comparing all contour pixels. The Euclidean distance is used. The parameters (Row1,Column1) and (Row2, Column2) indicate the position on the contour of Regions1 and Regions2, respectively, the distance between which is the minimum distance.


Attention

Each region must consist of exactly one connection component. Both input parameters must contain the same number of regions. The regions must not be empty. If the regions overlap the distance is indicated as 0.0. In this case the positions are not reliable.


Parameters

Regions1 (input_object)
region(-array) -> object
Regions to be examined.

Regions2 (input_object)
region(-array) -> object
Regions to be examined.

MinDistance (output_control)
real(-array) -> real
Minimum distance between contours of the regions.
Assertion: 0 <= MinDistance

Row1 (output_control)
point.y(-array) -> integer
Line index on contour in Regions1.

Column1 (output_control)
point.x(-array) -> integer
Column index on contour in Regions1.

Row2 (output_control)
point.y(-array) -> integer
Line index on contour in Regions2.

Column2 (output_control)
point.x(-array) -> integer
Column index on contour in Regions2.


Complexity

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


Result

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


Parallelization Information

distance_rr_min is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

threshold, regiongrowing, connection


Alternatives

distance_rr_min_dil, dilation1, intersection


Module

Region processing



Copyright © 1996-2005 MVTec Software GmbH