Image Component Library (ICL)
MarkerGridEvaluater.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 : ICLMarkers/src/ICLMarkers/MarkerGridEvaluater.h **
10 ** Module : ICLMarkers **
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 
34 #include <ICLMath/FixedVector.h>
35 
36 namespace icl{
37  namespace markers{
41 
42  const MarkerGrid *grid;
43  struct Line{
45  bool isNull;
46  int type;
47  operator bool() const { return !isNull; }
48  Line():isNull(true){}
49  Line(const utils::Point32f &a, const utils::Point32f &b):a(a),b(b),isNull(false){}
50  Line(const std::vector<utils::Point32f> &ps, float *error=0);
51 
52  struct PCAInfo{
55  V c;
58  bool isNull;
59  inline float getError() const { return fabs(evals[1]); }
60  operator bool() const { return !isNull; }
61  };
62  static PCAInfo perform_pca(const std::vector<utils::Point32f> &p);
63 
64  };
65  float error;
66  std::vector<Line> lines;
67 
68  MarkerGridEvaluater(const MarkerGrid *grid=0):grid(grid){}
69 
70  void setGrid(const MarkerGrid *grid) { this->grid = grid; }
71 
72  float evalError(bool storeLines=true);
73 
75 
76  static float compute_error(const MarkerGrid &g);
77 
78  private:
79  template<bool STORE_LINES>
80  void updateLines();
81  };
82  }
83 
84 }
const MarkerGrid * grid
Definition: MarkerGridEvaluater.h:42
undocument this line if you encounter any issues!
Definition: Any.h:37
int type
Definition: MarkerGridEvaluater.h:46
Line()
Definition: MarkerGridEvaluater.h:48
Line(const utils::Point32f &a, const utils::Point32f &b)
Definition: MarkerGridEvaluater.h:49
V evals
Definition: MarkerGridEvaluater.h:57
V c
Definition: MarkerGridEvaluater.h:55
bool isNull
Definition: MarkerGridEvaluater.h:58
Definition: MarkerGridEvaluater.h:52
MarkerGridEvaluater(const MarkerGrid *grid=0)
Definition: MarkerGridEvaluater.h:68
float getError() const
Definition: MarkerGridEvaluater.h:59
Definition: MarkerGridEvaluater.h:43
math::FixedColVector< float, 2 > V
Definition: MarkerGridEvaluater.h:53
Definition: MarkerGridEvaluater.h:38
utils::Point32f b
Definition: MarkerGridEvaluater.h:44
AdvancedMarkerGridDetector::MarkerGrid MarkerGrid
Definition: MarkerGridEvaluater.h:39
ICLCV_API void error(const char *msg)
Display error message and terminate program.
Abstract class for visualization tasks.
Definition: VisualizationDescription.h:73
bool isNull
Definition: MarkerGridEvaluater.h:45
math::FixedMatrix< float, 2, 2 > M
Definition: MarkerGridEvaluater.h:54
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
M evecs
Definition: MarkerGridEvaluater.h:56
internal data-class the represents a more sophisticated
Definition: AdvancedMarkerGridDetector.h:81
void setGrid(const MarkerGrid *grid)
Definition: MarkerGridEvaluater.h:70
Represents whole grid of markers.
Definition: AdvancedMarkerGridDetector.h:170
#define ICLMarkers_API
Definition: CompatMacros.h:180
std::vector< Line > lines
Definition: MarkerGridEvaluater.h:66
float error
Definition: MarkerGridEvaluater.h:65
AdvancedMarkerGridDetector::Marker Marker
Definition: MarkerGridEvaluater.h:40