Image Component Library (ICL)
VectorTracker.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/VectorTracker.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 <ICLUtils/CompatMacros.h>
34 #include <ICLUtils/Function.h>
35 #include <vector>
36 
37 namespace icl{
38  namespace cv{
39 
41 
45  public:
47  enum IDmode{
48  firstFree, // old unused IDs are re-used
49  brandNew // each new element gets a brand new ID (untils int-range ends)
50  };
51 
53  typedef std::vector<float> Vec;
54 
56 
58  VectorTracker();
59 
61 
90  VectorTracker(int dim, float largeDistance, const std::vector<float> &normFactors=std::vector<float>(),
91  IDmode idMode=firstFree, float distanceThreshold=0, bool tryOpt=true,
92  DistanceFunction df=DistanceFunction(), bool dfIsQualityFunction=false);
93 
95 
96  VectorTracker(const VectorTracker &other);
97 
99 
100  VectorTracker &operator=(const VectorTracker &other);
101 
103  ~VectorTracker();
104 
106  void pushData(const std::vector<Vec> &newData);
107 
109  int getID(int index, float *lastErrorOrScore=0) const;
110 
112  bool isNull() const;
113 
115  int getDim() const;
116 
118 
124  void setExtrapolationMask(const std::vector<bool> &mask);
125 
127  void setDistanceFunction(DistanceFunction df);
128 
130  const std::vector<bool> &getExtrapolationMask() const;
131 
132  private:
133 
135  struct Data;
136 
138  Data *m_data;
139  };
140 
141 
142  } // namespace cv
143 }
The General Function Template.
Definition: Function.h:284
undocument this line if you encounter any issues!
Definition: Any.h:37
IDmode
Determines how ids are allocated internally.
Definition: VectorTracker.h:47
std::vector< float > Vec
Vector Type.
Definition: VectorTracker.h:53
#define ICLCV_API
Definition: CompatMacros.h:177
utils::Function< float, const Vec &, const Vec & > DistanceFunction
Definition: VectorTracker.h:55
Extension of the position tracker class for N-dimensional positions.
Definition: VectorTracker.h:44
Data * m_data
internal data pointer
Definition: VectorTracker.h:135
Definition: VectorTracker.h:48