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.
HomographyInit.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Copyright 2008 Isis Innovation Limited
3 
4 // HomographyInit.h
5 // Declares the HomographyInit class and a few helper functions.
6 //
7 // This class is used by MapMaker to bootstrap the map, and implements
8 // the homography decomposition of Faugeras and Lustman's 1988 tech
9 // report.
10 //
11 // Implementation according to Faugeras and Lustman
12 
13 #ifndef __HOMOGRAPHY_INIT_H
14 #define __HOMOGRAPHY_INIT_H
15 #include "TooN.h"
16 using namespace TooN;
17 #include "se3.h"
18 #include <vector>
19 #include "globals.h"
20 
21 // Homography matches are 2D-2D matches in a stereo pair, unprojected
22 // to the Z=1 plane.
24 {
25  // To be filled in by MapMaker:
29 };
30 
31 // Storage for each homography decomposition
33 {
36  double d;
38 
39  // The resolved composition..
41  int nScore;
42 };
43 
45 {
46 public:
47  bool Compute(std::vector<HomographyMatch> vMatches, double dMaxPixelError, SE3<> &se3SecondCameraPose);
48 protected:
49  Matrix<3> HomographyFromMatches(std::vector<HomographyMatch> vMatches);
50  void BestHomographyFromMatches_MLESAC();
51  void DecomposeHomography();
52  void ChooseBestDecomposition();
53  void RefineHomographyWithInliers();
54 
55  bool IsHomographyInlier(Matrix<3> m3Homography, HomographyMatch match);
56  double MLESACScore(Matrix<3> m3Homography, HomographyMatch match);
57 
60  std::vector<HomographyMatch> mvMatches;
61  std::vector<HomographyMatch> mvHomographyInliers;
62  std::vector<HomographyDecomposition> mvDecompositions;
63 };
64 
65 
66 
67 #endif
std::vector< HomographyMatch > mvMatches
Everything lives inside this namespace.
Definition: allocator.hh:48
Definition: se3.h:50
Matrix< 2 > m2PixelProjectionJac
std::vector< HomographyMatch > mvHomographyInliers
double mdMaxPixelErrorSquared
std::vector< HomographyDecomposition > mvDecompositions
Vector< 2 > v2CamPlaneFirst
Matrix< 3 > mm3BestHomography
Vector< 2 > v2CamPlaneSecond