farm-ng-core
sophus::InverseDepthPoint3< TT > Class Template Reference

Inverse depth point representation. More...

#include <inverse_depth.h>

Public Member Functions

 InverseDepthPoint3 ()
 
 InverseDepthPoint3 (Eigen::Matrix< TT, 2, 1 > const &proj_in_z1_plane, TT const &one_by_z)
 
 InverseDepthPoint3 (TT const &x_by_z, TT const &y_by_z, TT const &one_by_z)
 
auto projInZ1Plane () const -> Eigen::Matrix< TT, 2, 1 >
 
auto psi () const -> TT const &
 Returns inverse depth psi, hence "1 / z". More...
 
auto psi () -> TT &
 
auto data () const -> TT const *
 
auto data () -> TT *
 
auto params () const -> Eigen::Matrix< TT, 3, 1 > const &
 
auto toEuclideanPoint3 () const -> Eigen::Matrix< TT, 3, 1 >
 Precondition: psi must not be close to 0, hence z must not be near infinity. More...
 

Static Public Member Functions

static auto fromEuclideanPoint3 (Eigen::Matrix< TT, 3, 1 > const &p) -> InverseDepthPoint3
 
static auto fromAbAndPsi (Eigen::Matrix< TT, 3, 1 > const &ab_and_psi) -> InverseDepthPoint3
 

Detailed Description

template<class TT>
class sophus::InverseDepthPoint3< TT >

Inverse depth point representation.

(a, b) := (x/z, y/z) and psi := 1/z

following https://ethaneade.com/thesis_revised.pdf, pp. 79

Let us assume we have Euclidean 3d point (x,y,z) in a local reference frame (e.g. camera origin). One can construct an inverse depth point (in the same local reference frame) as follows:

First we project the point (x,y,z) through the origin (0,0,0) onto the z=1 plane. We call the projection (a, b) := (x/z, y/z).

In other words, (a, b) is the intersection of the line through (0, 0, 0) to (x, y, z) and the 2d Euclidean plane z=1.

Now, we can describe almost any 3d point in our local reference frame as a point (a',b') in the Euclidean plane z=1 and the inverse depth psi := 1/z.

For example, the Euclidean point (2, 0, 8) is represented as (a, b) = (2/8, 0/8) = (1/4, 0) and inverse depth psi = 1/8.

The only Euclidean 3d point we cannot describe is the origin (0,0,0) (since there are infinitely many lines through the origin which intersect with the plane z=1).

The advantage of using an inverse depth representation over Euclidean representation is that we can also represent points at infinity. Let (a,b) a 2d Euclidean point on our reference plane z=1; nothing stops us from choosing a psi=0, which corresponds to a "z = 1/0 = infinity".

In summary, using this representation, we can represent

  • points at infinity: psi == 1/z == 0
  • points close to +infinity: psi == 1/z == +e
  • points close to -infinity: psi == 1/z == -e
  • points one unit in front: psi == 1/z == +1
  • points one unit behind: psi == 1/z == -1
  • points close to zero, in front: psi == 1/z == +999999
  • points close to zero, behind: psi == 1/z == -999999

Constructor & Destructor Documentation

◆ InverseDepthPoint3() [1/3]

template<class TT >
sophus::InverseDepthPoint3< TT >::InverseDepthPoint3 ( )
inline

◆ InverseDepthPoint3() [2/3]

template<class TT >
sophus::InverseDepthPoint3< TT >::InverseDepthPoint3 ( Eigen::Matrix< TT, 2, 1 > const &  proj_in_z1_plane,
TT const &  one_by_z 
)
inline

◆ InverseDepthPoint3() [3/3]

template<class TT >
sophus::InverseDepthPoint3< TT >::InverseDepthPoint3 ( TT const &  x_by_z,
TT const &  y_by_z,
TT const &  one_by_z 
)
inline

Member Function Documentation

◆ data() [1/2]

template<class TT >
auto sophus::InverseDepthPoint3< TT >::data ( ) -> TT*
inline

◆ data() [2/2]

template<class TT >
auto sophus::InverseDepthPoint3< TT >::data ( ) const -> TT const*
inline

◆ fromAbAndPsi()

template<class TT >
static auto sophus::InverseDepthPoint3< TT >::fromAbAndPsi ( Eigen::Matrix< TT, 3, 1 > const &  ab_and_psi) -> InverseDepthPoint3
inlinestatic

◆ fromEuclideanPoint3()

template<class TT >
static auto sophus::InverseDepthPoint3< TT >::fromEuclideanPoint3 ( Eigen::Matrix< TT, 3, 1 > const &  p) -> InverseDepthPoint3
inlinestatic

◆ params()

template<class TT >
auto sophus::InverseDepthPoint3< TT >::params ( ) const -> Eigen::Matrix<TT, 3, 1> const&
inline

◆ projInZ1Plane()

template<class TT >
auto sophus::InverseDepthPoint3< TT >::projInZ1Plane ( ) const -> Eigen::Matrix<TT, 2, 1>
inline

◆ psi() [1/2]

template<class TT >
auto sophus::InverseDepthPoint3< TT >::psi ( ) -> TT&
inline

◆ psi() [2/2]

template<class TT >
auto sophus::InverseDepthPoint3< TT >::psi ( ) const -> TT const&
inline

Returns inverse depth psi, hence "1 / z".

◆ toEuclideanPoint3()

template<class TT >
auto sophus::InverseDepthPoint3< TT >::toEuclideanPoint3 ( ) const -> Eigen::Matrix<TT, 3, 1>
inline

Precondition: psi must not be close to 0, hence z must not be near infinity.


The documentation for this class was generated from the following file: