SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
MapPoint.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Copyright 2008 Isis Innovation Limited
3 //
4 // This file declares the MapPoint class
5 //
6 // The map is made up of a bunch of mappoints.
7 // Each one is just a 3D point in the world;
8 // it also includes information on where and in which key-frame the point was
9 // originally made from, so that pixels from that keyframe can be used
10 // to search for that point.
11 // Also stores stuff like inlier/outlier counts, and privat information for
12 // both Tracker and MapMaker.
13 
14 #ifndef __MAP_POINT_H
15 #define __MAP_POINT_H
16 #include "TooN.h"
17 using namespace TooN;
18 #include "image_ref.h"
19 #include "timer.h"
20 #include <set>
21 #include "globals.h"
22 
23 class KeyFrame;
24 class TrackerData;
25 class MapMakerData;
26 
27 struct MapPoint
28 {
29  // Constructor inserts sensible defaults and zeros pointers.
30  inline MapPoint()
31  {
32  bBad = false;
33  pTData = NULL;
34  pMMData = NULL;
35  nMEstimatorOutlierCount = 0;
36  nMEstimatorInlierCount = 0;
37  dCreationTime = CVD::timer.get_time();
38  };
39 
40  // Where in the world is this point? The main bit of information, really.
41  Vector<3> v3WorldPos;
42  // Is it a dud? In that case it'll be moved to the trash soon.
43  bool bBad;
44 
45  // What pixels should be used to search for this point?
46  KeyFrame *pPatchSourceKF; // The KeyFrame the point was originally made in
47  int nSourceLevel; // Pyramid level in source KeyFrame
48  CVD::ImageRef irCenter; // This is in level-coords in the source pyramid level
49 
50  // What follows next is a bunch of intermediate vectors - they all lead up
51  // to being able to calculate v3Pixel{Down,Right}_W, which the PatchFinder
52  // needs for patch warping!
53 
54  Vector<3> v3Center_NC; // Unit vector in Source-KF coords pointing at the patch center
55  Vector<3> v3OneDownFromCenter_NC; // Unit vector in Source-KF coords pointing towards one pixel down of the patch center
56  Vector<3> v3OneRightFromCenter_NC; // Unit vector in Source-KF coords pointing towards one pixel right of the patch center
57  Vector<3> v3Normal_NC; // Unit vector in Source-KF coords indicating patch normal
58 
59  Vector<3> v3PixelDown_W; // 3-Vector in World coords corresponding to a one-pixel move down the source image
60  Vector<3> v3PixelRight_W; // 3-Vector in World coords corresponding to a one-pixel move right the source image
61  void RefreshPixelVectors(); // Calculates above two vectors
62 
63  // Info for the Mapmaker (not to be trashed by the tracker:)
65 
66  // Info for the Tracker (not to be trashed by the MapMaker:)
68 
69  // Info provided by the tracker for the mapmaker:
72 
73  // Random junk (e.g. for visualisation)
74  double dCreationTime; //timer.get_time() time of creation
75 };
76 
77 #endif
Vector< 3 > v3PixelRight_W
Definition: MapPoint.h:60
bool bBad
Definition: MapPoint.h:43
double get_time()
How many seconds have elapsed since the start time?
Definition: cvd_timer.cpp:54
int nMEstimatorOutlierCount
Definition: MapPoint.h:70
Vector< 3 > v3Center_NC
Definition: MapPoint.h:54
Vector< 3 > v3OneDownFromCenter_NC
Definition: MapPoint.h:55
Everything lives inside this namespace.
Definition: allocator.hh:48
Vector< 3 > v3Normal_NC
Definition: MapPoint.h:57
MapMakerData * pMMData
Definition: MapPoint.h:64
MapPoint()
Definition: MapPoint.h:30
cvd_timer timer
Definition: cvd_timer.cpp:82
double dCreationTime
Definition: MapPoint.h:74
int nSourceLevel
Definition: MapPoint.h:47
CVD::ImageRef irCenter
Definition: MapPoint.h:48
Vector< 3 > v3PixelDown_W
Definition: MapPoint.h:59
Vector< 3 > v3OneRightFromCenter_NC
Definition: MapPoint.h:56
int nMEstimatorInlierCount
Definition: MapPoint.h:71
KeyFrame * pPatchSourceKF
Definition: MapPoint.h:46
TrackerData * pTData
Definition: MapPoint.h:67