DistanceTransform2D Class Reference

an abstract 2D distance transform class More...

#include <DistanceTransform2D.h>

Inheritance diagram for DistanceTransform2D:

Chamfer_3x3 Chamfer_5x5 Chamfer_7x7 Chessboard Cityblock CSED DeadReckoning DijkstraVectors EightSED errorfreeCSED Euclidean FourSED ModifiedDijkstra Simple SimpleList List of all members.

Public Member Functions

 DistanceTransform2D (const int xSize, const int ySize, const bool unload=true)
 construct a distance transform object for an image of size (xSize,ySize).
virtual void doTransform (const unsigned char *const I)=0
 calculate the distance transform
double getD (const int x, const int y) const
 return the distance value assigned to a particular position
virtual bool getP (const int x, const int y, int &px, int &py) const
 return the "parent" (border point) associated with this point

Static Public Attributes

static const int IntInfinity = INT_MAX / 2
static const double FloatInfinity = FLT_MAX / 2.0

Protected Member Functions

int sub (const int x, const int y) const
template<class T>
void initImmediate (const unsigned char *const I, T *d, const T halfDx=0, const T halfDy=0)
 init elements of the immediate interior (i.e., border points).
template<class T>
void check (T *d, const int center, const int X, const int Y, const T Delta)
virtual void borderCheck (const unsigned char *const I)
void cleanUp ()
void finish (const unsigned char *const I, double *d)
void finish (const unsigned char *const I, int *d, const int dx, const int dy)

Protected Attributes

int xSize
 integer size (width) in pixels
int ySize
 integer size (height) in pixels
double * dD
 result of distance transform (as doubles)
int * iD
 the calculated distance transform (as ints)

Private Attributes

int * rowOffsets
 used to speed up 2d array indexing
bool unloadFlag
 convert ints to doubles (if necessary)

Classes

class  P
 DistanceTransform::P class. Simply a 2D point. More...

Detailed Description

an abstract 2D distance transform class


Constructor & Destructor Documentation

DistanceTransform2D::DistanceTransform2D const int  xSize,
const int  ySize,
const bool  unload = true
 

construct a distance transform object for an image of size (xSize,ySize).

if 'unload' is true, transforms that use ratios of integers should convert their integer results to the actual double values (of the ratios).


Member Function Documentation

void DistanceTransform2D::finish const unsigned char *const   I,
int *  d,
const int  dx,
const int  dy
[protected]
 

called to finish up after distance transform employing ints

void DistanceTransform2D::finish const unsigned char *const   I,
double *  d
[protected]
 

called to finish up after distance transform employing doubles

virtual bool DistanceTransform2D::getP const int  x,
const int  y,
int &  px,
int &  py
const [virtual]
 

return the "parent" (border point) associated with this point

Parameters:
x is the x location
y is the y location
px is the parent's x location to be returned
py is the parent's y location to be returned
Returns:
true if the parent is know; otherwise false.

Reimplemented in CSED, DeadReckoning, DijkstraVectors, EightSED, errorfreeCSED, ModifiedDijkstra, Simple, and SimpleList.

int DistanceTransform2D::sub const int  x,
const int  y
const [protected]
 

given a point (x,y) in an image, this method returns the corresponding 1d subscript into the 1d image array


Member Data Documentation

const double DistanceTransform2D::FloatInfinity = FLT_MAX / 2.0 [static]
 

a double representing infinity (but one such that smaller values may still be added to it)

const int DistanceTransform2D::IntInfinity = INT_MAX / 2 [static]
 

an integer representing infinity (but one such that smaller values may still be added to it)


The documentation for this class was generated from the following files:
Generated on Thu Jul 27 11:25:33 2006 by  doxygen 1.4.6