[mmOpen] [Up] [mmGdist] Image Transforms

mmDist
Distance transform.

Synopsis

Image mmDist ( const Image& f , const Strel& Bc = NullStrel, const String& METRIC = NullString );

Input

f Image [ Binary image ]

Bc Structuring Element

(connectivity)

Default: NullStrel (3x3 elementary cross)

METRIC String

'EUCLIDEAN', or 'EUC2' for squared Euclidean.

Default: NullString

Output

y Image

distance image in uint16, or in int32 datatype with EUC2 option.

Description

mmDist creates the distance image y of the binary image f. The value of y at the pixel x is the distance of x to the complement of f, that is, the distance of x to nearest point in the complement of f. The distances available are based on the Euclidean metrics and on metrics generated by a a regular graph, that is characterized by a connectivity rule defined by the structuring element Bc. The implementation of the Euclidean algorithm is based on [LZ01].

Equation

distance of a point x to a set X:
distance function:
distance function using structuring element:
Relationship between erosion and distance transform:

Limitations

To generate useful Distance transforms, the structuring elements must be symmetric and have the origin included. The Euclidean distance transform is rounded to the nearest integer, since it is represented as an unsigned integer image. Use the option EUC2 to compute exact squared Euclidean distance transform.

See also

mmEro Erode an image by a structuring element.
mmGdist Geodesic Distance Transform.
mmSebox Create a box structuring element.
mmSecross Diamond structuring element and elementary 3x3 cross.
[mmOpen] [Up] [mmGdist]