Image Component Library (ICL)
ViewBasedTemplateMatcher.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLCV/src/ICLCV/ViewBasedTemplateMatcher.h **
10 ** Module : ICLCV **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLCV/CV.h>
35 
36 namespace icl{
37  namespace cv{
38 
41  public:
42 
44  enum mode{
47  };
48 
50 
60  ViewBasedTemplateMatcher(float significance=0.9, mode m=sqrtDistance, bool clipBuffersToROI = false);
61 
63 
65  void setSignificance(float significance);
66 
68  void setMode(mode m);
69 
71  void setClipBuffersToROI(bool flag);
72 
74  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);
75 
77  const core::Img8u getBuffer() { return p2o(m_aoBuffers[2].selectChannel(0)); }
78 
79  private:
85  std::vector<utils::Rect> m_vecResults;
86  };
87 
88  } // namespace cv
89 }
90 
static const Img< icl8u > null
null sized and null channel image
Definition: Img.h:167
ICLUtils_API MatchResult match(const std::string &text, const std::string &regex, int numSubMatches=0)
Applies a regular expression match on given text and regex pattern (internally using regex....
undocument this line if you encounter any issues!
Definition: Any.h:37
float m_fSignificance
significance level
Definition: ViewBasedTemplateMatcher.h:80
mode m_eMode
matching mode
Definition: ViewBasedTemplateMatcher.h:81
#define ICLCV_API
Definition: CompatMacros.h:177
TemplateMatching class (wrapping UsefulFunctions::matchTemplate)
Definition: ViewBasedTemplateMatcher.h:40
static T p2o(T *ptr)
Conversion function to transform a pointer into an object.
Definition: Img.h:1639
use normalized cross correlation proximity measurement
Definition: ViewBasedTemplateMatcher.h:46
utils::UncopiedInstance< RegionDetector > m_oRD
internally recycled RegionDetector instance
Definition: ViewBasedTemplateMatcher.h:83
bool m_bClipBuffersToROI
buffer clipping mode
Definition: ViewBasedTemplateMatcher.h:82
use square distance proximity measurement
Definition: ViewBasedTemplateMatcher.h:45
const core::Img8u getBuffer()
returns the interanly used binary buffer buffer
Definition: ViewBasedTemplateMatcher.h:77
std::vector< utils::Rect > m_vecResults
internal result buffer
Definition: ViewBasedTemplateMatcher.h:85
mode
internally use matching mode
Definition: ViewBasedTemplateMatcher.h:44
Utility class for class instances that are created brand new on copy.
Definition: UncopiedInstance.h:72