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

◆ mode

internally use matching mode

Enumerator
sqrtDistance 

use square distance proximity measurement

crossCorrelation 

use normalized cross correlation proximity measurement

Constructor & Destructor Documentation

◆ ViewBasedTemplateMatcher()

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

◆ getBuffer()

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

returns the interanly used binary buffer buffer

◆ match()

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)

◆ setClipBuffersToROI()

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

set buffer clipping mode (see constructor description)

◆ setMode()

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

set matching mode (see constructor description)

◆ setSignificance()

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

◆ m_aoBuffers

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

interanlly used buffers

◆ m_bClipBuffersToROI

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

buffer clipping mode

◆ m_eMode

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

matching mode

◆ m_fSignificance

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

significance level

◆ m_oRD

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

internally recycled RegionDetector instance

◆ m_vecResults

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

internal result buffer


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