TemplateMatchChannel Class Reference

Convolves each level of its pyramid with a feature template. More...

#include <Channels/TemplateMatchChannel.H>

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

List of all members.

Public Member Functions

 TemplateMatchChannel (OptionManager &mgr, const Image< float > &filt)
 Construct with the standard params, plus a filter specification.
virtual ~TemplateMatchChannel ()
 Virtual destructor.
void findBestMatch (const Rectangle &r, Point2D< int > &matchpos, int &match_lev, float &score)
 Look for the most likely template match in a given rectangular region.
virtual void drawResults (Image< PixRGB< byte > > &traj, const Rectangle &foa)
 Draws a box in traj around the last best template match found.

Protected Member Functions

virtual void start1 ()

Protected Attributes

Point2D< int > itsBestMatchPos
int itsBestMatchLev
float itsBestMatchScore
Dims itsFiltDims

Detailed Description

Convolves each level of its pyramid with a feature template.

This type of channel is useful for searching for a specific feature shape at multiple scales. For example, it is used by VisualCortex to search for possible pedestrians in an input image.

Definition at line 48 of file TemplateMatchChannel.H.


Constructor & Destructor Documentation

TemplateMatchChannel::TemplateMatchChannel ( OptionManager mgr,
const Image< float > &  filt 
)

Construct with the standard params, plus a filter specification.

The filter is specified by a C array, which will be interpreted to have dimensions filt_x and filt_y. A private copy of the filter will be made, so the filt pointer does not have to be persistent.

Definition at line 54 of file TemplateMatchChannel.C.

TemplateMatchChannel::~TemplateMatchChannel (  )  [virtual]

Virtual destructor.

Definition at line 65 of file TemplateMatchChannel.C.


Member Function Documentation

void TemplateMatchChannel::drawResults ( Image< PixRGB< byte > > &  traj,
const Rectangle foa 
) [virtual]

Draws a box in traj around the last best template match found.

Definition at line 105 of file TemplateMatchChannel.C.

References drawRect(), findBestMatch(), Dims::h(), Point2D< T >::i, max(), min(), Rectangle::tlbrI(), and Dims::w().

void TemplateMatchChannel::findBestMatch ( const Rectangle r,
Point2D< int > &  matchpos,
int &  match_lev,
float &  score 
)

Look for the most likely template match in a given rectangular region.

The position of the match in 0-level coordinates is returned in matchpos, the pyramid level at which the match was found is returned in match_lev, and a score rating the goodness of the match is returned in score.

Definition at line 74 of file TemplateMatchChannel.C.

References findMax(), SingleChannel::getImage(), ChannelBase::getInputDims(), OModelParam< T >::getVal(), Point2D< T >::i, Rectangle::left(), LevelSpec::levMax(), LevelSpec::levMin(), rescale(), and Rectangle::top().

Referenced by drawResults().

void TemplateMatchChannel::start1 (  )  [protected, virtual]

If you overload this, make sure you call SingleChannel::start1() at the beginning of your overload

Reimplemented from SingleChannel.

Reimplemented in PedestrianChannel.

Definition at line 68 of file TemplateMatchChannel.C.


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