TrackerOrientation.h
Go to the documentation of this file.
1 /*
2  * This file is part of ALVAR, A Library for Virtual and Augmented Reality.
3  *
4  * Copyright 2007-2012 VTT Technical Research Centre of Finland
5  *
6  * Contact: VTT Augmented Reality Team <alvar.info@vtt.fi>
7  * <http://www.vtt.fi/multimedia/alvar.html>
8  *
9  * ALVAR is free software; you can redistribute it and/or modify it under the
10  * terms of the GNU Lesser General Public License as published by the Free
11  * Software Foundation; either version 2.1 of the License, or (at your option)
12  * any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
17  * for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with ALVAR; if not, see
21  * <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>.
22  */
23 
24 #ifndef TRACKERORIENTATION_H
25 #define TRACKERORIENTATION_H
26 
27 #include "Tracker.h"
28 #include "TrackerFeatures.h"
29 #include "Pose.h"
30 #include "Camera.h"
31 
38 namespace alvar {
39 
44 
45 public:
46  TrackerOrientation(int width, int height, int image_scale=1, int outlier_limit=20)
47  : _image_scale(image_scale)
48  , _outlier_limit(outlier_limit)
49  , _xres(width)
50  , _yres(height)
51  {
52  _camera = 0;
53  _grsc = 0;
54  _object_model = 0;
55  }
56 
57 private:
58 
59  struct Feature
60  {
61  enum {NOT_TRACKED=0, IS_TRACKED} status2D;
62  enum {NONE=0, USE_FOR_POSE, IS_OUTLIER, IS_INITIAL} status3D;
63 
65  {
66  status3D = NONE;
67  status2D = NOT_TRACKED;
68  }
69 
70  Feature(double vx, double vy)
71  {
72  point.x = float(vx);
73  point.y = float(vy);
74  status3D = NONE;
75  status2D = NOT_TRACKED;
76  }
77 
78  ~Feature() {}
79 
80  CvPoint2D32f point;
81  CvPoint3D64f point3d;
82  };
83 
85  std::map<int,Feature> _F_v;
86 
87  int _xres;
88  int _yres;
91 
93  IplImage *_grsc;
95  CvMat *_object_model;
96 
97 public:
99  _camera = camera;
100  }
101  void GetPose(Pose &pose);
102  void GetPose(double gl_mat[16]) {
103  _pose.GetMatrixGL(gl_mat);
104  }
105  void Reset();
106  double Track(IplImage *image);
107 
108 private:
109  static void Project(CvMat* state, CvMat* projection, void *param);
110  bool UpdatePose(IplImage* image=0);
111  bool UpdateRotationOnly(IplImage *gray, IplImage *image=0);
112 
113 };
114 
115 } // namespace alvar
116 
117 #endif
118 
119 
Main ALVAR namespace.
Definition: Alvar.h:174
bool param(const std::string &param_name, T &param_val, const T &default_val)
This file implements a tracking interface.
This file implements a camera used for projecting points and computing homographies.
void GetMatrixGL(double gl[16], bool mirror=true)
Get the transformation matrix representation of the Pose using OpenGL&#39;s transposed format...
Definition: Pose.cpp:104
unsigned char * image
Definition: GlutViewer.cpp:155
void GetPose(double gl_mat[16])
Track orientation based only on features in the image plane.
int height
Definition: GlutViewer.cpp:160
Simple Camera class for calculating distortions, orientation or projections with pre-calibrated camer...
Definition: Camera.h:82
static void Project(CvMat *state, CvMat *projection, void *x)
Definition: EC.cpp:50
Pure virtual base class for tracking optical flow.
Definition: Tracker.h:43
std::map< int, Feature > _F_v
This file implements a feature tracker.
Camera * camera
Pose representation derived from the Rotation class
Definition: Pose.h:50
int width
Definition: GlutViewer.cpp:159
TrackerOrientation(int width, int height, int image_scale=1, int outlier_limit=20)
cv::Mat gray
TrackerFeatures tracks features using OpenCV&#39;s cvGoodFeaturesToTrack and cvCalcOpticalFlowPyrLK ...
#define ALVAR_EXPORT
Definition: Alvar.h:168
void SetCamera(Camera *camera)
This file implements a pose.


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Mon Jun 10 2019 12:47:04