Functions
core/vil/algo/vil_distance_transform.h File Reference

Compute distance function. More...

#include <vil/vil_image_view.h>

Go to the source code of this file.

Functions

void vil_distance_transform (vil_image_view< float > &image)
 Compute distance function from zeros in original image.
void vil_distance_transform_one_way (vil_image_view< float > &image)
 Compute directed distance function from zeros in original image.
void vil_distance_transform (const vil_image_view< bool > &mask, vil_image_view< float > &distance_image, float max_dist)
 Compute distance function from true elements in mask.
void vil_distance_transform_r2 (vil_image_view< float > &image)
 Compute distance function from zeros in original image.

Detailed Description

Compute distance function.

Author:
Tim Cootes

Definition in file vil_distance_transform.h.


Function Documentation

void vil_distance_transform ( vil_image_view< float > &  image)

Compute distance function from zeros in original image.

Image is assumed to be filled with max_dist where there is background, and zero at the places of interest. On exit, the values are the 8-connected distance to the nearest original zero region.

Definition at line 17 of file vil_distance_transform.cxx.

void vil_distance_transform ( const vil_image_view< bool > &  mask,
vil_image_view< float > &  distance_image,
float  max_dist 
)

Compute distance function from true elements in mask.

On exit, the values are the 8-connected distance to the nearest original zero region (or max_dist, if that is smaller).

Definition at line 85 of file vil_distance_transform.cxx.

void vil_distance_transform_one_way ( vil_image_view< float > &  image)

Compute directed distance function from zeros in original image.

Image is assumed to be filled with max_dist where there is background, and zero at the places of interest. On exit, the values are the 8-connected distance to the nearest original zero region above or to the left of current point. One pass of distance transform, going from low to high i,j.

Definition at line 38 of file vil_distance_transform.cxx.

void vil_distance_transform_r2 ( vil_image_view< float > &  image)

Compute distance function from zeros in original image.

Image is assumed to be filled with max_dist where there is background, and zero at the places of interest. On exit, the values are the 24-connected distance to the nearest original zero region. (ie considers neighbours in a +/-2 pixel region around each point). More accurate than vil_distance_transform(image), but approximately twice the processing required.

Definition at line 231 of file vil_distance_transform.cxx.