Convolves each level of its pyramid with a feature template. More...
#include <Channels/TemplateMatchChannel.H>
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 |
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.
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.
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.