min_distance2 ( Regions1, Regions2 : : : Distance, Row1, Column1, Row2, Column2 )

Minimum distance between the contour pixels of two regions each.

The operator min_distance2 calculates the minimum distance of paris of regions. If several regions are passed in Regions1 and Regions2 the distance between the contour pixels of each i-th element is calculted and then form the i-th entry in the output parameter Distance. The calculation is carried out by comparing all contour pixels. The Euclidean distance is calculated. The parameters (Row1,Column1) or (Row2, Column2), respectively, indicate the position on the contour of Regions1 or 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.

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

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 min_distance2 returns the value TRUE if the input is not empty. Otherwise an exception is raised.


Possible Predecessors

threshold__, regiongrowing__, connection


Alternatives

min_distance1, dilation1, intersection



Copyright © 1996-1997 MVTec Software GmbH