Image Component Library (ICL)
Public Types | Public Member Functions | Private Attributes | List of all members
icl::cv::ViewBasedTemplateMatcher Class Reference

TemplateMatching class (wrapping UsefulFunctions::matchTemplate) More...

#include <ViewBasedTemplateMatcher.h>

Public Types

enum  mode { sqrtDistance, crossCorrelation }
 internally use matching mode More...
 

Public Member Functions

 ViewBasedTemplateMatcher (float significance=0.9, mode m=sqrtDistance, bool clipBuffersToROI=false)
 Create a new ViewBasedTemplateMatcher instance with given matching significance and mode. More...
 
void setSignificance (float significance)
 set significance level More...
 
void setMode (mode m)
 set matching mode (see constructor description) More...
 
void setClipBuffersToROI (bool flag)
 set buffer clipping mode (see constructor description) More...
 
const std::vector< utils::Rect > & match (const core::Img8u &image, const core::Img8u &templ, const core::Img8u &imageMask=core::Img8u::null, const core::Img8u &templMask=core::Img8u::null)
 apply matching with given image and template (optionally image and template masks can be given) More...
 
const core::Img8u getBuffer ()
 returns the interanly used binary buffer buffer More...
 

Private Attributes

float m_fSignificance
 significance level More...
 
mode m_eMode
 matching mode More...
 
bool m_bClipBuffersToROI
 buffer clipping mode More...
 
utils::UncopiedInstance< RegionDetectorm_oRD
 internally recycled RegionDetector instance More...
 
utils::UncopiedInstance< core::Img8um_aoBuffers [3]
 interanlly used buffers More...
 
std::vector< utils::Rectm_vecResults
 internal result buffer More...
 

Detailed Description

TemplateMatching class (wrapping UsefulFunctions::matchTemplate)

Member Enumeration Documentation

internally use matching mode

Enumerator
sqrtDistance 

use square distance proximity measurement

crossCorrelation 

use normalized cross correlation proximity measurement

Constructor & Destructor Documentation

icl::cv::ViewBasedTemplateMatcher::ViewBasedTemplateMatcher ( float  significance = 0.9,
mode  m = sqrtDistance,
bool  clipBuffersToROI = false 
)

Create a new ViewBasedTemplateMatcher instance with given matching significance and mode.

Parameters
significancesignificance level for matching appropriate range depends on matching mode
mmatching mode:
  • sqrtDistance (better mode for good matching) appropriate range; [0.5,...]
  • crossCorrelation appropriate range: [0.92, ...]
clipBuffersToROIif set, internally all buffers are clipped to ROI. This might be usefull, if given templates and source images do change size in successive calls otherwise, it's more efficient, to use buffers of constant size and to adapt the bufers ROI only.

Member Function Documentation

const core::Img8u icl::cv::ViewBasedTemplateMatcher::getBuffer ( )
inline

returns the interanly used binary buffer buffer

const std::vector<utils::Rect>& icl::cv::ViewBasedTemplateMatcher::match ( const core::Img8u image,
const core::Img8u templ,
const core::Img8u imageMask = core::Img8u::null,
const core::Img8u templMask = core::Img8u::null 
)

apply matching with given image and template (optionally image and template masks can be given)

void icl::cv::ViewBasedTemplateMatcher::setClipBuffersToROI ( bool  flag)

set buffer clipping mode (see constructor description)

void icl::cv::ViewBasedTemplateMatcher::setMode ( mode  m)

set matching mode (see constructor description)

void icl::cv::ViewBasedTemplateMatcher::setSignificance ( float  significance)

set significance level

Parameters
significancesignificance level (apropriate range depends on matching mode
See also
class constructor for more detail

Member Data Documentation

utils::UncopiedInstance<core::Img8u> icl::cv::ViewBasedTemplateMatcher::m_aoBuffers[3]
private

interanlly used buffers

bool icl::cv::ViewBasedTemplateMatcher::m_bClipBuffersToROI
private

buffer clipping mode

mode icl::cv::ViewBasedTemplateMatcher::m_eMode
private

matching mode

float icl::cv::ViewBasedTemplateMatcher::m_fSignificance
private

significance level

utils::UncopiedInstance<RegionDetector> icl::cv::ViewBasedTemplateMatcher::m_oRD
private

internally recycled RegionDetector instance

std::vector<utils::Rect> icl::cv::ViewBasedTemplateMatcher::m_vecResults
private

internal result buffer


The documentation for this class was generated from the following file: