Compute distance function. More...
#include "vil_distance_transform.h"
#include <vil/vil_fill.h>
#include <vcl_algorithm.h>
#include <vcl_cmath.h>
#include <vcl_cassert.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_one_way (vil_image_view< float > &image) |
Distance function, using neighbours +/-2 in x,y. | |
void | vil_distance_transform_r2 (vil_image_view< float > &image) |
Compute distance function from zeros in original image. |
Compute distance function.
Definition in file vil_distance_transform.cxx.
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.
void vil_distance_transform_r2_one_way | ( | vil_image_view< float > & | image | ) |
Distance function, using neighbours +/-2 in x,y.
More accurate than vil_distance_function_one_way
Definition at line 98 of file vil_distance_transform.cxx.