ShapeModel Class Reference

The base class for shape models. More...

#include <BeoSub/CannyModel.H>

Inheritance diagram for ShapeModel:
Inheritance graph
[legend]
Collaboration diagram for ShapeModel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ShapeModel (const int ndims, const double thresh, double *dims, const bool debug=false)
 Constructor.
virtual ~ShapeModel ()
 Destructor.
double calcDist (double p[], const Image< float > &distMap) const
 Compute distance between model (defined by p) and distance map.
double getThreshold () const
 Get the distance threshold.
int getNumDims () const
 Get the number of dimensions.
double * getDimensions () const
 Get the dimension vector.
void setDimensions (double *in)
 Set the dimension vector.

Protected Member Functions

float getDistVal (const double x, const double y, const Image< float > &distMap, Image< PixRGB< byte > > &xdisp) const
 get distance value at one location, with optional display
virtual float getDist (double p[], const Image< float > &distMap, Image< PixRGB< byte > > &xdisp) const =0
 Core of the distance computation.

Detailed Description

The base class for shape models.

This base class defines a basic interface by which an shape optimizer may mathematically represent a shape and get a measurement of how well the current shape matches with a Canny edge map.

Definition at line 60 of file CannyModel.H.


Constructor & Destructor Documentation

ShapeModel::ShapeModel ( const int  ndims,
const double  thresh,
double *  dims,
const bool  debug = false 
)

Constructor.

Constructor

Parameters:
ndims number of dimensions in the model
thresh threshold for a shape match
debug if true, open an XWindow and show debug drawings.

Definition at line 45 of file CannyModel.C.

ShapeModel::~ShapeModel (  )  [virtual]

Destructor.

Definition at line 60 of file CannyModel.C.

References rutz::shared_ptr< T >::reset().


Member Function Documentation

double ShapeModel::calcDist ( double  p[],
const Image< float > &  distMap 
) const

Compute distance between model (defined by p) and distance map.

Programmer's note: calcDist() is a wrapper around getDist() which does the actual distance computation. Do not overload calcDist(), overload getDist() instead.

Definition at line 122 of file CannyModel.C.

References rutz::shared_ptr< T >::get(), Image< T >::getDims(), getDist(), Image< T >::getWidth(), rutz::shared_ptr< T >::reset(), and toRGB().

double * ShapeModel::getDimensions (  )  const

Get the dimension vector.

Definition at line 73 of file CannyModel.C.

virtual float ShapeModel::getDist ( double  p[],
const Image< float > &  distMap,
Image< PixRGB< byte > > &  xdisp 
) const [protected, pure virtual]

Core of the distance computation.

This is a pure virtual function, derived classes need to implement it.

Implemented in RectangleShape, SquareShape, OctagonShape, CircleShape, and ParallelShape.

Referenced by calcDist().

float ShapeModel::getDistVal ( const double  x,
const double  y,
const Image< float > &  distMap,
Image< PixRGB< byte > > &  xdisp 
) const [protected]
int ShapeModel::getNumDims (  )  const

Get the number of dimensions.

Definition at line 70 of file CannyModel.C.

double ShapeModel::getThreshold (  )  const

Get the distance threshold.

Definition at line 66 of file CannyModel.C.

void ShapeModel::setDimensions ( double *  in  ) 

Set the dimension vector.

Definition at line 83 of file CannyModel.C.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:48 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3