OpenGV
A library for solving calibrated central and non-central geometric vision problems
opengv::relative_pose Namespace Reference

The namespace for the relative pose methods. More...

Classes

class  CentralRelativeAdapter
 
class  CentralRelativeMultiAdapter
 
class  CentralRelativeWeightingAdapter
 
class  MACentralRelative
 
class  MANoncentralRelative
 
class  MANoncentralRelativeMulti
 
class  NoncentralRelativeAdapter
 
class  NoncentralRelativeMultiAdapter
 
class  RelativeAdapterBase
 
class  RelativeMultiAdapterBase
 

Functions

translation_t twopt (const RelativeAdapterBase &adapter, bool unrotate, const std::vector< int > &indices)
 Compute the translation between two central viewpoints with known relative rotation, and using two correspondences. More...
 
translation_t twopt (const RelativeAdapterBase &adapter, bool unrotate, size_t index0=0, size_t index1=1)
 Compute the translation between two central viewpoints with known relative rotation, and using two correspondences. More...
 
rotation_t twopt_rotationOnly (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the rotation between two central viewpoints with pure rotation change, using only two correspondences. More...
 
rotation_t twopt_rotationOnly (const RelativeAdapterBase &adapter, size_t index0=0, size_t index1=1)
 Compute the rotation between two central viewpoints with pure rotation change, using only two correspondences. More...
 
rotation_t rotationOnly (const RelativeAdapterBase &adapter)
 Compute the rotation between two central viewpoints with pure rotation change using Arun's method [13]. Using all available correspondences. More...
 
rotation_t rotationOnly (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the rotation between two central viewpoints with pure rotation change using Arun's method [13]. More...
 
complexEssentials_t fivept_stewenius (const RelativeAdapterBase &adapter)
 Compute the complex essential matrices between two central viewpoints using Stewenius' method [5]. Using all available correspondences. More...
 
complexEssentials_t fivept_stewenius (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the complex essential matrices between two central viewpoints using Stewenius' method [5]. More...
 
essentials_t fivept_nister (const RelativeAdapterBase &adapter)
 Compute the essential matrices between two central viewpoints using Nister's method [6]. Using all available correspondences. More...
 
essentials_t fivept_nister (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the essential matrices between two central viewpoints using Nister's method [6]. More...
 
rotations_t fivept_kneip (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the rotation matrices between two central viewpoints using Kneips's method [7]. Only minimal case. More...
 
essentials_t sevenpt (const RelativeAdapterBase &adapter)
 Compute the essential matrices between two central viewpoints using the seven-point algorithm [8]. Using all available correspondences. More...
 
essentials_t sevenpt (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the essential matrices between two central viewpoints using the seven-point algorithm [8]. More...
 
essential_t eightpt (const RelativeAdapterBase &adapter)
 Compute the essential matrix between two central viewpoints using the eight-point algorithm [9,10]. Using all available correspondences. More...
 
essential_t eightpt (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the essential matrix between two central viewpoints using the eight-point algorithm [9,10]. More...
 
rotation_t eigensolver (const RelativeAdapterBase &adapter, eigensolverOutput_t &output, bool useWeights=false)
 Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11]. Using all available correspondences. More...
 
rotation_t eigensolver (const RelativeAdapterBase &adapter, const std::vector< int > &indices, eigensolverOutput_t &output, bool useWeights=false)
 Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11]. More...
 
rotation_t eigensolver (const RelativeAdapterBase &adapter, bool useWeights=false)
 Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11]. Using all available correspondences. Outputs only the rotation. More...
 
rotation_t eigensolver (const RelativeAdapterBase &adapter, const std::vector< int > &indices, bool useWeights=false)
 Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11]. Outputs only the rotation. More...
 
rotations_t sixpt (const RelativeAdapterBase &adapter)
 Compute the relative rotation between two non-central viewpoints following Stewenius' method [16]. Assuming exactly 6 correspondences. More...
 
rotations_t sixpt (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the relative rotation between two non-central viewpoints following Stewenius' method using 6 correspondences [16]. More...
 
rotation_t ge (const RelativeAdapterBase &adapter, geOutput_t &output, bool useWeights=false)
 Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem. Using all available correspondences. More...
 
rotation_t ge (const RelativeAdapterBase &adapter, const std::vector< int > &indices, geOutput_t &output, bool useWeights=false)
 Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem. More...
 
rotation_t ge (const RelativeAdapterBase &adapter, bool useWeights=false)
 Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem. Using all available correspondences. Outputs only the rotation. More...
 
rotation_t ge (const RelativeAdapterBase &adapter, const std::vector< int > &indices, bool useWeights=false)
 Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem. Outputs only the rotation. More...
 
transformation_t seventeenpt (const RelativeAdapterBase &adapter)
 Compute the relative pose between two non-central viewpoints following Li's method [12]. Using all available correspondences. More...
 
transformation_t seventeenpt (const RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the relative pose between two non-central viewpoints following Li's method [12]. More...
 
transformation_t optimize_nonlinear (RelativeAdapterBase &adapter)
 Compute the pose between two viewpoints using nonlinear optimization. Using all available correspondences. Works for both central and non-central case. More...
 
transformation_t optimize_nonlinear (RelativeAdapterBase &adapter, const std::vector< int > &indices)
 Compute the pose between two viewpoints using nonlinear optimization. Works for both central and non-central case. More...
 

Detailed Description

The namespace for the relative pose methods.

Function Documentation

rotation_t opengv::relative_pose::eigensolver ( const RelativeAdapterBase adapter,
eigensolverOutput_t output,
bool  useWeights = false 
)

Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11]. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
[out]outputReturns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::eigensolver ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices,
eigensolverOutput_t output,
bool  useWeights = false 
)

Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11].

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
[in]indicesIndices of the correspondences used for deriving the rotation matrix.
[out]outputReturns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::eigensolver ( const RelativeAdapterBase adapter,
bool  useWeights = false 
)

Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11]. Using all available correspondences. Outputs only the rotation.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::eigensolver ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices,
bool  useWeights = false 
)

Compute the rotation matrix between two central viewpoints as an iterative eigenproblem [11]. Outputs only the rotation.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
[in]indicesIndices of the correspondences used for deriving the rotation matrix.
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
essential_t opengv::relative_pose::eightpt ( const RelativeAdapterBase adapter)

Compute the essential matrix between two central viewpoints using the eight-point algorithm [9,10]. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
Returns
Real essential matrix ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1).
essential_t opengv::relative_pose::eightpt ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the essential matrix between two central viewpoints using the eight-point algorithm [9,10].

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]indicesIndices of the correspondences used for deriving the essential matrix.
Returns
Real essential matrix ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1).
rotations_t opengv::relative_pose::fivept_kneip ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the rotation matrices between two central viewpoints using Kneips's method [7]. Only minimal case.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]indicesIndices of the correspondences used for deriving the rotation matrices.
Returns
Rotation matrices from viewpoint 2 to viewpoint 1 (maximum 20 solutions).
essentials_t opengv::relative_pose::fivept_nister ( const RelativeAdapterBase adapter)

Compute the essential matrices between two central viewpoints using Nister's method [6]. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
Returns
Real essential matrices ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).
essentials_t opengv::relative_pose::fivept_nister ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the essential matrices between two central viewpoints using Nister's method [6].

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]indicesIndices of the correspondences used for deriving the essential matrices.
Returns
Real essential matrices ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).
complexEssentials_t opengv::relative_pose::fivept_stewenius ( const RelativeAdapterBase adapter)

Compute the complex essential matrices between two central viewpoints using Stewenius' method [5]. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
Returns
Complex essential matrices ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).
complexEssentials_t opengv::relative_pose::fivept_stewenius ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the complex essential matrices between two central viewpoints using Stewenius' method [5].

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]indicesIndices of the correspondences used for deriving the essential matrices.
Returns
Complex essential matrices ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).
rotation_t opengv::relative_pose::ge ( const RelativeAdapterBase adapter,
geOutput_t output,
bool  useWeights = false 
)

Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
[out]outputReturns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::ge ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices,
geOutput_t output,
bool  useWeights = false 
)

Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
[in]indicesIndices of the correspondences used for deriving the rotation matrix.
[out]outputReturns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::ge ( const RelativeAdapterBase adapter,
bool  useWeights = false 
)

Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem. Using all available correspondences. Outputs only the rotation.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::ge ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices,
bool  useWeights = false 
)

Compute the rotation matrix between two non-central viewpoints as an iterative eigenproblem. Outputs only the rotation.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
[in]indicesIndices of the correspondences used for deriving the rotation matrix.
[in]useWeightsUse weights to weight the summation terms?
Returns
Rotation matrix from viewpoint 2 to viewpoint 1.
transformation_t opengv::relative_pose::optimize_nonlinear ( RelativeAdapterBase adapter)

Compute the pose between two viewpoints using nonlinear optimization. Using all available correspondences. Works for both central and non-central case.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, the multi-camera configuration, plus the initial values.
Returns
Pose of viewpoint 2 seen from viewpoint 1 ( $ \mathbf{T} = \left(\begin{array}{cc} \mathbf{R} & \mathbf{t} \end{array}\right) $, with $ \mathbf{t} $ being the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ being the rotation from viewpoint 2 to viewpoint 1).
transformation_t opengv::relative_pose::optimize_nonlinear ( RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the pose between two viewpoints using nonlinear optimization. Works for both central and non-central case.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, the multi-camera configuration, plus the initial values.
[in]indicesIndices of the correspondences used for deriving the pose.
Returns
Pose of viewpoint 2 seen from viewpoint 1 ( $ \mathbf{T} = \left(\begin{array}{cc} \mathbf{R} & \mathbf{t} \end{array}\right) $, with $ \mathbf{t} $ being the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ being the rotation from viewpoint 2 to viewpoint 1).
rotation_t opengv::relative_pose::rotationOnly ( const RelativeAdapterBase adapter)

Compute the rotation between two central viewpoints with pure rotation change using Arun's method [13]. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
Returns
Rotation from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::rotationOnly ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the rotation between two central viewpoints with pure rotation change using Arun's method [13].

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]indicesIndices of the correspondences used for deriving the rotation.
Returns
Rotation from viewpoint 2 to viewpoint 1.
essentials_t opengv::relative_pose::sevenpt ( const RelativeAdapterBase adapter)

Compute the essential matrices between two central viewpoints using the seven-point algorithm [8]. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
Returns
Real essential matrices ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1, maximum 3 solutions).
essentials_t opengv::relative_pose::sevenpt ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the essential matrices between two central viewpoints using the seven-point algorithm [8].

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]indicesIndices of the correspondences used for deriving the essential matrices.
Returns
Real essential matrices ( $ \mathbf{E}= $ skew $(\mathbf{t})\mathbf{R}$, where $ \mathbf{t} $ is the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ is the rotation from viewpoint 2 back to viewpoint 1, maximum 3 solutions).
transformation_t opengv::relative_pose::seventeenpt ( const RelativeAdapterBase adapter)

Compute the relative pose between two non-central viewpoints following Li's method [12]. Using all available correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the multi-camera configuration.
Returns
Pose of viewpoint 2 seen from viewpoint 1 ( $ \mathbf{T} = \left(\begin{array}{cc} \mathbf{R} & \mathbf{t} \end{array}\right) $, with $ \mathbf{t} $ being the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ being the rotation from viewpoint 2 to viewpoint 1).
transformation_t opengv::relative_pose::seventeenpt ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the relative pose between two non-central viewpoints following Li's method [12].

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the multi-camera configuration.
[in]indicesIndices of the correspondences used for deriving the rotation matrix.
Returns
Pose of viewpoint 2 seen from viewpoint 1 ( $ \mathbf{T} = \left(\begin{array}{cc} \mathbf{R} & \mathbf{t} \end{array}\right) $, with $ \mathbf{t} $ being the position of viewpoint 2 seen from viewpoint 1, and $ \mathbf{R} $ being the rotation from viewpoint 2 to viewpoint 1).
rotations_t opengv::relative_pose::sixpt ( const RelativeAdapterBase adapter)

Compute the relative rotation between two non-central viewpoints following Stewenius' method [16]. Assuming exactly 6 correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the multi-camera configuration.
Returns
Rotations from viewpoint 2 back to viewpoint 1
rotations_t opengv::relative_pose::sixpt ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the relative rotation between two non-central viewpoints following Stewenius' method using 6 correspondences [16].

Parameters
[in]adapterVisitor holding bearing-vector correspondences, plus the multi-camera configuration.
[in]indicesIndices of the six correspondences used for deriving the rotation matrix.
Returns
Rotations from viewpoint 2 back to viewpoint 1
translation_t opengv::relative_pose::twopt ( const RelativeAdapterBase adapter,
bool  unrotate,
const std::vector< int > &  indices 
)

Compute the translation between two central viewpoints with known relative rotation, and using two correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences and known relative rotation.
[in]unrotateSet to true if known rotation should be used to unrotate bearing vectors from viewpoint 2 (not required in case of identity rotation).
[in]indicesIndices of the two correspondences used for deriving the translation.
Returns
Position of viewpoint 2 seen from viewpoint 1.
translation_t opengv::relative_pose::twopt ( const RelativeAdapterBase adapter,
bool  unrotate,
size_t  index0 = 0,
size_t  index1 = 1 
)

Compute the translation between two central viewpoints with known relative rotation, and using two correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences and known relative rotation.
[in]unrotateSet to true if known rotation should be used to unrotate bearing vectors from viewpoint 2 (not required in case of identity rotation).
[in]index0Index of the first correspondence used for deriving the translation (use default value if only two provided anyway).
[in]index1Index of the second correspondence used for deriving the translation (use default vector if only two provided anyway).
Returns
Position of viewpoint 2 seen from viewpoint 1.
rotation_t opengv::relative_pose::twopt_rotationOnly ( const RelativeAdapterBase adapter,
const std::vector< int > &  indices 
)

Compute the rotation between two central viewpoints with pure rotation change, using only two correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]indicesIndices of the two correspondences used for deriving the rotation.
Returns
Rotation from viewpoint 2 to viewpoint 1.
rotation_t opengv::relative_pose::twopt_rotationOnly ( const RelativeAdapterBase adapter,
size_t  index0 = 0,
size_t  index1 = 1 
)

Compute the rotation between two central viewpoints with pure rotation change, using only two correspondences.

Parameters
[in]adapterVisitor holding bearing-vector correspondences.
[in]index0Index of the first correspondence used for deriving the rotation (use default value if only two provided anyway).
[in]index1Index of the second correspondence used for deriving the rotation (use default value if only two provided anyway).
Returns
Rotation from viewpoint 2 to viewpoint 1.