Loading...
Searching...
No Matches
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.
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.
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.
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.
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.
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].
complexEssentials_t | fivept_stewenius (const RelativeAdapterBase &adapter)
| Compute the complex essential matrices between two central viewpoints using Stewenius' method [5]. Using all available correspondences.
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].
essentials_t | fivept_nister (const RelativeAdapterBase &adapter)
| Compute the essential matrices between two central viewpoints using Nister's method [6]. Using all available correspondences.
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].
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.
essentials_t | sevenpt (const RelativeAdapterBase &adapter)
| Compute the essential matrices between two central viewpoints using the seven-point algorithm [8]. Using all available correspondences.
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].
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.
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].
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.
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].
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.
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.
rotations_t | sixpt (const RelativeAdapterBase &adapter)
| Compute the relative rotation between two non-central viewpoints following Stewenius' method [16]. Assuming exactly 6 correspondences.
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].
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.
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.
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.
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.
transformation_t | seventeenpt (const RelativeAdapterBase &adapter)
| Compute the relative pose between two non-central viewpoints following Li's method [12]. Using all available correspondences.
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].
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.
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.

## Detailed Description

The namespace for the relative pose methods.

## Function Documentation

## eigensolver() [1/4]

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] | adapter | Visitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## eigensolver() [2/4]

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] | adapter | Visitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
  [in] | indices | Indices of the correspondences used for deriving the rotation matrix.
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## eigensolver() [3/4]

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] | adapter | Visitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
  [in] | indices | Indices of the correspondences used for deriving the rotation matrix.
  [out] | output | Returns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## eigensolver() [4/4]

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] | adapter | Visitor holding bearing-vector correspondences, plus the initial rotation for the optimization.
  [out] | output | Returns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## eightpt() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences.

Returns
  Real essential matrix ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1).

## eightpt() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | indices | Indices of the correspondences used for deriving the essential matrix.

Returns
  Real essential matrix ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1).

## fivept_kneip()

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | indices | Indices of the correspondences used for deriving the rotation matrices.

Returns
  Rotation matrices from viewpoint 2 to viewpoint 1 (maximum 20 solutions).

## fivept_nister() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences.

Returns
  Real essential matrices ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).

## fivept_nister() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | indices | Indices of the correspondences used for deriving the essential matrices.

Returns
  Real essential matrices ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).

## fivept_stewenius() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences.

Returns
  Complex essential matrices ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).

## fivept_stewenius() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | indices | Indices of the correspondences used for deriving the essential matrices.

Returns
  Complex essential matrices ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1, maximum of 10 solutions).

## ge() [1/4]

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] | adapter | Visitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## ge() [2/4]

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] | adapter | Visitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
  [in] | indices | Indices of the correspondences used for deriving the rotation matrix.
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## ge() [3/4]

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] | adapter | Visitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
  [in] | indices | Indices of the correspondences used for deriving the rotation matrix.
  [out] | output | Returns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## ge() [4/4]

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] | adapter | Visitor holding bearing-vector correspondences, the multi- camera configuration, plus the initial rotation for the optimization.
  [out] | output | Returns more complete information (position of viewpoint 2 seen from viewpoint 1, eigenvectors and eigenvalues)
  [in] | useWeights | Use weights to weight the summation terms?

Returns
  Rotation matrix from viewpoint 2 to viewpoint 1.

## optimize_nonlinear() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences, the multi-camera configuration, plus the initial values.

Returns
  Pose of viewpoint 2 seen from viewpoint 1 ( , with being the position of viewpoint 2 seen from viewpoint 1, and being the rotation from viewpoint 2 to viewpoint 1).

## optimize_nonlinear() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences, the multi-camera configuration, plus the initial values.
  [in] | indices | Indices of the correspondences used for deriving the pose.

Returns
  Pose of viewpoint 2 seen from viewpoint 1 ( , with being the position of viewpoint 2 seen from viewpoint 1, and being the rotation from viewpoint 2 to viewpoint 1).

## rotationOnly() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences.

Returns
  Rotation from viewpoint 2 to viewpoint 1.

## rotationOnly() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | indices | Indices of the correspondences used for deriving the rotation.

Returns
  Rotation from viewpoint 2 to viewpoint 1.

## sevenpt() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences.

Returns
  Real essential matrices ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1, maximum 3 solutions).

## sevenpt() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | indices | Indices of the correspondences used for deriving the essential matrices.

Returns
  Real essential matrices ( skew , where is the position of viewpoint 2 seen from viewpoint 1, and is the rotation from viewpoint 2 back to viewpoint 1, maximum 3 solutions).

## seventeenpt() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences, plus the multi-camera configuration.

Returns
  Pose of viewpoint 2 seen from viewpoint 1 ( , with being the position of viewpoint 2 seen from viewpoint 1, and being the rotation from viewpoint 2 to viewpoint 1).

## seventeenpt() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences, plus the multi-camera configuration.
  [in] | indices | Indices of the correspondences used for deriving the rotation matrix.

Returns
  Pose of viewpoint 2 seen from viewpoint 1 ( , with being the position of viewpoint 2 seen from viewpoint 1, and being the rotation from viewpoint 2 to viewpoint 1).

## sixpt() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences, plus the multi-camera configuration.

Returns
  Rotations from viewpoint 2 back to viewpoint 1

## sixpt() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences, plus the multi-camera configuration.
  [in] | indices | Indices of the six correspondences used for deriving the rotation matrix.

Returns
  Rotations from viewpoint 2 back to viewpoint 1

## twopt() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences and known relative rotation.
  [in] | unrotate | Set to true if known rotation should be used to unrotate bearing vectors from viewpoint 2 (not required in case of identity rotation).
  [in] | indices | Indices of the two correspondences used for deriving the translation.

Returns
  Position of viewpoint 2 seen from viewpoint 1.

## twopt() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences and known relative rotation.
  [in] | unrotate | Set to true if known rotation should be used to unrotate bearing vectors from viewpoint 2 (not required in case of identity rotation).
  [in] | index0 | Index of the first correspondence used for deriving the translation (use default value if only two provided anyway).
  [in] | index1 | Index 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.

## twopt_rotationOnly() [1/2]

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | indices | Indices of the two correspondences used for deriving the rotation.

Returns
  Rotation from viewpoint 2 to viewpoint 1.

## twopt_rotationOnly() [2/2]

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] | adapter | Visitor holding bearing-vector correspondences.
  [in] | index0 | Index of the first correspondence used for deriving the rotation (use default value if only two provided anyway).
  [in] | index1 | Index 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.