Image Component Library (ICL)
|
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< RegionDetector > | m_oRD |
internally recycled RegionDetector instance More... | |
utils::UncopiedInstance< core::Img8u > | m_aoBuffers [3] |
interanlly used buffers More... | |
std::vector< utils::Rect > | m_vecResults |
internal result buffer More... | |
TemplateMatching class (wrapping UsefulFunctions::matchTemplate)
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.
significance | significance level for matching appropriate range depends on matching mode |
m | matching mode:
|
clipBuffersToROI | if 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. |
|
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
significance | significance level (apropriate range depends on matching mode |
|
private |
interanlly used buffers
|
private |
buffer clipping mode
|
private |
matching mode
|
private |
significance level
|
private |
internally recycled RegionDetector instance
|
private |
internal result buffer