[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
![]() |
Distance Transform | ![]() |
Functions | |
template<... > | |
void | distanceTransform (...) |
Perform a distance transform using either the Euclidean, Manhattan, or chessboard metrics.
See also: multi-dimensional distance transforms
void vigra::distanceTransform | ( | ... | ) |
For all background pixels, calculate the distance to the nearest object or contour. The label of the pixels to be considered background in the source image is passed in the parameter 'background'. Source pixels with other labels will be considered objects. In the destination image, all pixels corresponding to background will be assigned the their distance value, all pixels corresponding to objects will be assigned 0.
The parameter 'norm' gives the distance norm to be used:
norm == 2: use Euclidean distance (L2 norm)
If you use the L2 norm, the destination pixels must be real valued to give correct results.
Declarations:
pass 2D array views:
Usage:
#include <vigra/distancetransform.hxx>
Namespace: vigra
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |