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.cpp
Go to the documentation of this file.
1 // Copyright 2008 Isis Innovation Limited
2 #include "MapPoint.h"
3 #include "KeyFrame.h"
5 {
7 
8  // Find patch pos in KF camera coords
9  // Actually this might not exactly correspond to the patch pos!
10  // Treat it as a general point on the plane.
11  Vector<3> v3PlanePoint_C = k.se3CfromW * v3WorldPos;
12 
13  // Find the height of this above the plane.
14  // Assumes the normal is pointing toward the camera.
15  double dCamHeight = fabs(v3PlanePoint_C * v3Normal_NC);
16 
17  double dPixelRate = fabs(v3Center_NC * v3Normal_NC);
18  double dOneRightRate = fabs(v3OneRightFromCenter_NC * v3Normal_NC);
19  double dOneDownRate = fabs(v3OneDownFromCenter_NC * v3Normal_NC);
20 
21  // Find projections onto plane
22  Vector<3> v3CenterOnPlane_C = v3Center_NC * dCamHeight / dPixelRate;
23  Vector<3> v3OneRightOnPlane_C = v3OneRightFromCenter_NC * dCamHeight / dOneRightRate;
24  Vector<3> v3OneDownOnPlane_C = v3OneDownFromCenter_NC * dCamHeight / dOneDownRate;
25 
26  // Find differences of these projections in the world frame
27  v3PixelRight_W = k.se3CfromW.get_rotation().inverse() * (v3OneRightOnPlane_C - v3CenterOnPlane_C);
28  v3PixelDown_W = k.se3CfromW.get_rotation().inverse() * (v3OneDownOnPlane_C - v3CenterOnPlane_C);
29 }
Vector< 3 > v3PixelRight_W
Definition: MapPoint.h:60
SO3< Precision > & get_rotation()
Returns the rotation part of the transformation as a SO3.
Definition: se3.h:64
Vector< 3 > v3Center_NC
Definition: MapPoint.h:54
Vector< 3 > v3OneDownFromCenter_NC
Definition: MapPoint.h:55
Vector< 3 > v3Normal_NC
Definition: MapPoint.h:57
Vector< 3 > v3PixelDown_W
Definition: MapPoint.h:59
SE3 se3CfromW
Definition: KeyFrame.h:82
Vector< 3 > v3WorldPos
Definition: MapPoint.h:38
Vector< 3 > v3OneRightFromCenter_NC
Definition: MapPoint.h:56
KeyFrame * pPatchSourceKF
Definition: MapPoint.h:46
void RefreshPixelVectors()
Definition: MapPoint.cpp:4