iRoCS Toolbox
1.1.0
|
Exact 1-D euclidean distance transform using lower parabola embedding [1]. More...
#include "libArrayToolbox/DistanceTransform.hh"
Public Types | |
enum | Mode { DistanceToForeground, DistanceToBackground } |
DistanceTransform.hh "libArrayToolbox/DistanceTransform.hh". More... | |
Public Member Functions | |
EuclideanDistanceTransformBase (int capacity) | |
Create a new EuclideanDistanceTransformBase object with given maximum line length. More... | |
~EuclideanDistanceTransformBase () | |
Destructor. More... | |
void | run (int n) |
Apply the line transform to data stored in f. More... | |
Data Fields | |
std::vector< double > | _v |
The angular points of parabola contributing to the lower distance envelope. More... | |
std::vector< double > | _z |
The intervals of parabola contributing to the lower distance envelope. More... | |
std::vector< double > | d |
The squared eucliden distances of f. More... | |
std::vector< double > | f |
The input to process the distance transform for. More... | |
Static Public Attributes | |
static double | BG_VALUE |
Assign background pixels this value and foreground pixels value 0. More... | |
Exact 1-D euclidean distance transform using lower parabola embedding [1].
This line transform allows to compute distance transforms of arbitrary- dimensional data by subsequent dimension-wise application.
[1] P. Felzenszwalb and D. Huttenlocher. Theory of Computing, Vol. 8, No. 19, September 2012
Definition at line 64 of file DistanceTransform.hh.
DistanceTransform.hh "libArrayToolbox/DistanceTransform.hh".
The Mode enum specifies whether the distance to foreground or background pixels is computed.
Enumerator | |
---|---|
DistanceToForeground | Compute distance to nearest foreground pixel. |
DistanceToBackground | Compute distance to nearest background pixel. |
Definition at line 74 of file DistanceTransform.hh.
atb::EuclideanDistanceTransformBase::EuclideanDistanceTransformBase | ( | int | capacity | ) |
Create a new EuclideanDistanceTransformBase object with given maximum line length.
capacity | The maximum line length to process |
atb::EuclideanDistanceTransformBase::~EuclideanDistanceTransformBase | ( | ) |
Destructor.
void atb::EuclideanDistanceTransformBase::run | ( | int | n | ) |
Apply the line transform to data stored in f.
After processing, d contains the squared euclidean distances, _v contains the locations of the angular points of the parabola and _z the intervals on which the corresponding parabola has smallest value, i.e. values of parabola i with angular point (_v[i], f(_v[i])) are smaller than values of all other parabola in interval (_z[i], _z[i+1]). Only parabola contributing to the lower envelope are contained.
n | The length of the line |
|
static |
Assign background pixels this value and foreground pixels value 0.
Definition at line 85 of file DistanceTransform.hh.
std::vector<double> atb::EuclideanDistanceTransformBase::f |
The input to process the distance transform for.
Can be a raw binary 1-D Array containing 0 for foreground and BG_VALUE for background or the result of previous line transforms in orthogonal dimensions for n-D data.
Definition at line 127 of file DistanceTransform.hh.
std::vector<double> atb::EuclideanDistanceTransformBase::d |
The squared eucliden distances of f.
Definition at line 134 of file DistanceTransform.hh.
std::vector<double> atb::EuclideanDistanceTransformBase::_z |
The intervals of parabola contributing to the lower distance envelope.
Definition at line 141 of file DistanceTransform.hh.
std::vector<double> atb::EuclideanDistanceTransformBase::_v |
The angular points of parabola contributing to the lower distance envelope.
Definition at line 149 of file DistanceTransform.hh.