|
Ocean
|
This class implements a container allowing to define gravity constraints during e.g., camera poses estimation or optimization. More...
#include <GravityConstraints.h>
Public Member Functions | |
| GravityConstraintsT ()=default | |
| Creates a default constraint object with invalid parameters. | |
| GravityConstraintsT (const VectorT3< T > &cameraGravityInCamera, const VectorT3< T > &worldGravityInWorld=VectorT3< T >(0, -1, 0), const T weightFactor=T(1), const T maximalAngle=NumericT< T >::deg2rad(5)) | |
| Creates a new gravity constraints object for one camera for which the gravity vector is known (in the camera coordinate system). | |
| GravityConstraintsT (VectorsT3< T > &&cameraGravityInCameras, const VectorT3< T > &worldGravityInWorld=VectorT3< T >(0, -1, 0), const T weightFactor=T(1), const T maximalAngle=NumericT< T >::deg2rad(5)) | |
| Creates a new gravity constraints object for several cameras for which the gravity vectors are known (in the camera coordinate system). | |
| GravityConstraintsT (const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &worldGravityInWorld=VectorT3< T >(0, -1, 0), const T weightFactor=T(1), const T maximalAngle=NumericT< T >::deg2rad(5)) | |
| Creates a new gravity constraints object for one camera for which the precise camera pose is known. | |
| GravityConstraintsT (const HomogenousMatricesT4< T > &world_T_cameras, const VectorT3< T > &worldGravityInWorld=VectorT3< T >(0, -1, 0), const T weightFactor=T(1), const T maximalAngle=NumericT< T >::deg2rad(5)) | |
| Creates a new gravity constraints object for several cameras for which the precise camera poses are known. | |
| GravityConstraintsT (const GravityConstraintsT< T > &constraints, const size_t cameraIndex) | |
| Creates a new gravity constraints object for a single camera from a given constraints object with several cameras. | |
| GravityConstraintsT (const GravityConstraintsT< T > *constraints, const size_t cameraIndex) | |
| Creates a new gravity constraints object for a single camera from a given constraints object with several cameras. | |
| const VectorT3< T > & | cameraGravityInCamera (const size_t cameraIndex=0) const |
| Returns the camera gravity vector (which is known for a camera pose), defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards. | |
| VectorT3< T > | cameraGravityInFlippedCamera (const size_t cameraIndex=0) const |
| Returns the camera gravity vector (which is known for a camera pose), defined in the flipped camera coordinate system, with default flipped camera pointing towards the positive z-axis and y-axis pointing downwards. | |
| VectorT3< T > | cameraGravityInWorld (const QuaternionT< T > &world_Q_camera, const size_t cameraIndex=0) const |
| Returns the camera gravity vector (which is known for a camera pose), defined in the world coordinate system. | |
| VectorT3< T > | cameraGravityInWorld (const HomogenousMatrixT4< T > &world_T_camera, const size_t cameraIndex=0) const |
| Returns the camera gravity vector (which is known for a camera pose), defined in the world coordinate system. | |
| const Gravities & | cameraGravitiesInCamera () const |
| Returns the camera gravity vectors (which are known for one or several camera poses) defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards. | |
| const VectorT3< T > & | worldGravityInWorld () const |
| Returns the world gravity vector defined in the world coordinate system. | |
| VectorT3< T > | worldGravityInFlippedCameraIF (const QuaternionT< T > &flippedCamera_Q_world) const |
| Returns the world gravity vector defined in the flipped camera coordinate system, with default flipped camera pointing towards the positive z-axis and y-axis pointing downwards. | |
| VectorT3< T > | worldGravityInFlippedCameraIF (const HomogenousMatrixT4< T > &flippedCamera_T_world) const |
| Returns the world gravity vector defined in the flipped camera coordinate system, with default flipped camera pointing towards the positive z-axis and y-axis pointing downwards. | |
| QuaternionT< T > | world_R_camera (const size_t cameraIndex) const |
| Returns one possible rotation between camera and world. | |
| QuaternionT< T > | camera_R_world (const size_t cameraIndex) const |
| Returns one possible rotation between world and camera. | |
| QuaternionT< T > | flippedCamera_R_world (const size_t cameraIndex) const |
| Returns one possible rotation between world and the flipped camera. | |
| T | weightFactor () const |
| Returns the weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a normal/default gravity correction, larger values to apply a stronger gravity correction. | |
| T | maximalAngle () const |
| Returns the maximal angle between world and camera gravity vectors (when converted into the same coordinate system), can be used e.g., when the camera pose is determined e.g., with RANSAC or a PnP algorithm. | |
| T | minimalAngleCos () const |
| Returns the cosine value of maximalAngle(). | |
| size_t | numberCameras () const |
| Returns the number of cameras for which gravity constraints are defined. | |
| T | alignmentCosine (const QuaternionT< T > &world_Q_camera, const size_t cameraIndex=0) const |
| Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system). | |
| T | alignmentCosine (const HomogenousMatrixT4< T > &world_T_camera, const size_t cameraIndex=0) const |
| Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian. | |
| T | alignmentCosineIF (const QuaternionT< T > &flippedCamera_Q_world, const size_t cameraIndex=0) const |
| Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian. | |
| T | alignmentCosineIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const size_t cameraIndex=0) const |
| Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian. | |
| T | alignmentAngle (const QuaternionT< T > &world_Q_camera, const size_t cameraIndex=0) const |
| Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian. | |
| T | alignmentAngle (const HomogenousMatrixT4< T > &world_T_camera, const size_t cameraIndex=0) const |
| Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian. | |
| T | alignmentAngleIF (const QuaternionT< T > &flippedCamera_Q_world, const size_t cameraIndex=0) const |
| Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian. | |
| T | alignmentAngleIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const size_t cameraIndex=0) const |
| Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian. | |
| bool | isCameraAlignedWithGravity (const QuaternionT< T > &world_Q_camera, const size_t cameraIndex=0) const |
| Returns whether a camera pose is aligned with the gravity constraints using the specified angle threshold. | |
| bool | isCameraAlignedWithGravity (const HomogenousMatrixT4< T > &world_T_camera, const size_t cameraIndex=0) const |
| Returns whether a camera pose is aligned with the gravity constraints using the specified angle threshold. | |
| bool | isCameraAlignedWithGravityIF (const QuaternionT< T > &flippedCamera_Q_world, const size_t cameraIndex=0) const |
| Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using the specified angle threshold. | |
| bool | isCameraAlignedWithGravityIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const size_t cameraIndex=0) const |
| Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using the specified angle threshold. | |
| bool | isCameraAlignedWithGravity (const QuaternionT< T > &world_Q_camera, const size_t cameraIndex, const T maxAngle) const |
| Returns whether a camera pose is aligned with the gravity constraints using a custom angle threshold. | |
| bool | isCameraAlignedWithGravity (const HomogenousMatrixT4< T > &world_T_camera, const size_t cameraIndex, const T maxAngle) const |
| Returns whether a camera pose is aligned with the gravity constraints using a custom angle threshold. | |
| bool | isCameraAlignedWithGravityIF (const QuaternionT< T > &flippedCamera_Q_world, const size_t cameraIndex, const T maxAngle) const |
| Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using a custom angle threshold. | |
| bool | isCameraAlignedWithGravityIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const size_t cameraIndex, const T maxAngle) const |
| Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using a custom angle threshold. | |
| HomogenousMatrixT4< T > | alignCameraWithGravity (const HomogenousMatrixT4< T > &world_T_camera, const size_t cameraIndex=0) const |
| Rotates a camera pose so that the camera is aligned with the gravity constraints. | |
| HomogenousMatrixT4< T > | alignCameraWithGravityIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const size_t cameraIndex=0) const |
| Rotates a inverted and flipped camera pose so that the flipped camera is aligned with the gravity constraints. | |
| const GravityConstraintsT< T > * | conditionalPointer (const bool pointerIfValid=true) const |
| Returns the pointer to this gravity constraints object if it is valid. | |
| bool | isValid () const |
| Returns whether this constraint object holds valid parameters. | |
Static Public Member Functions | |
| static VectorT3< T > | cameraGravityInCamera (const QuaternionT< T > &camera_Q_world, const VectorT3< T > &worldGravityInWorld) |
| Helper function returning the camera gravity vector in the camera coordinate system based on a given camera pose and the world gravity vector. | |
| static VectorT3< T > | cameraGravityInCamera (const HomogenousMatrixT4< T > &camera_T_world, const VectorT3< T > &worldGravityInWorld) |
| Helper function returning the camera gravity vector in the camera coordinate system based on a given camera pose and the world gravity vector. | |
| static VectorT3< T > | cameraGravityInCameraIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &worldGravityInWorld) |
| Helper function returning the camera gravity vector in the camera coordinate system based on a given camera pose and the world gravity vector. | |
| static VectorT3< T > | cameraGravityInFlippedCameraIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &worldGravityInWorld) |
| Helper function returning the camera gravity vector in the flipped camera coordinate system based on a given camera pose and the world gravity vector. | |
Protected Types | |
| using | Gravities = StackHeapVector< VectorT3< T >, 2 > |
| Definition of a vector holding gravity vectors. | |
Protected Attributes | |
| Gravities | cameraGravityInCameras_ |
| The gravity vectors which are known for one or more camera poses, defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards. | |
| VectorT3< T > | worldGravityInWorld_ = VectorT3<T>(0, -1, 0) |
| The world gravity vector defined in the world coordinate system, mainly defining how the world coordinate system is oriented/aligned wrt gravity. | |
| T | weightFactor_ = T(-1) |
| The weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a full gravity correction; with range [0, 1). | |
| T | maximalAngle_ = T(-1) |
| The maximal angle between world and camera gravity vectors (when converted into the same coordinate system), can be used e.g., when the camera pose is determined e.g., with RANSAC or a PnP algorithm, in radian, with range [0, PI/2). | |
| T | minimalAngleCos_ = T(-1) |
| The cosine value of maximalAngle(), with range [0, 1]. | |
This class implements a container allowing to define gravity constraints during e.g., camera poses estimation or optimization.
The constraint is defined by a gravity vector defined in the world coordinate system (e.g., VectorT3<T>(0, -1, 0) for a gravity vector pointing towards the earth, in case the y-axis is pointing towards the sky).
Further, the constraints define a gravity vector for each camera, defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards.
The camera gravity vector(s) may be provided by a IMU sensor.
All gravity vectors must be normalized (must be unit vectors).
| T | The data type of a scalar, either 'float' or 'double' |
|
protected |
Definition of a vector holding gravity vectors.
|
default |
Creates a default constraint object with invalid parameters.
|
inlineexplicit |
Creates a new gravity constraints object for one camera for which the gravity vector is known (in the camera coordinate system).
| gravityInCamera | The camera gravity vector (which is known for a camera pose), defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards. |
| worldGravityInWorld | The world gravity vector in the world coordinate system, mainly defining how the world coordinate system is oriented/aligned wrt gravity |
| weightFactor | The weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a normal/default gravity correction, larger values to apply a stronger gravity correction, with range [0, infinity) |
| maximalAngle | The maximal angle between world and camera gravity vector (when converted into the same coordinate system), can be used e.g., when the camera pose is determined e.g., with RANSAC or a PnP algorithm, in radian, with range [0, PI/2). |
|
inlineexplicit |
Creates a new gravity constraints object for several cameras for which the gravity vectors are known (in the camera coordinate system).
| gravityInCameras | The camera gravity vectors (which are known for several camera poses), defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards. |
| worldGravityInWorld | The world gravity vector in the world coordinate system, mainly defining how the world coordinate system is oriented/aligned wrt gravity |
| weightFactor | The weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a normal/default gravity correction, larger values to apply a stronger gravity correction, with range [0, infinity) |
| maximalAngle | The maximal angle between world and camera gravity vectors (when converted into the same coordinate system), can be used e.g., when the camera pose is determined e.g., with RANSAC or a PnP algorithm, in radian, with range [0, PI/2). |
|
inlineexplicit |
Creates a new gravity constraints object for one camera for which the precise camera pose is known.
The camera gravity vector is determined from the precise camera pose.
| world_T_camera | The transformation transforming camera to world, with default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| worldGravityInWorld | The world gravity vector in the world coordinate system, mainly defining how the world coordinate system is oriented/aligned wrt gravity |
| weightFactor | The weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a normal/default gravity correction, larger values to apply a stronger gravity correction, with range [0, infinity) |
| maximalAngle | The maximal angle between world and camera gravity vector (when converted into the same coordinate system), can be used e.g., when the camera pose is determined e.g., with RANSAC or a PnP algorithm, in radian, with range [0, PI/2). |
|
inlineexplicit |
Creates a new gravity constraints object for several cameras for which the precise camera poses are known.
The camera gravity vectors are determined from the precise camera poses.
| world_T_cameras | The transformations transforming camera to world, with default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| worldGravityInWorld | The world gravity vector in the world coordinate system, mainly defining how the world coordinate system is oriented/aligned wrt gravity |
| weightFactor | The weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a normal/default gravity correction, larger values to apply a stronger gravity correction, with range [0, infinity) |
| maximalAngle | The maximal angle between world and camera gravity vectors (when converted into the same coordinate system), can be used e.g., when the camera pose is determined e.g., with RANSAC or a PnP algorithm, in radian, with range [0, PI/2). |
|
inline |
Creates a new gravity constraints object for a single camera from a given constraints object with several cameras.
| constraints | The constraints object with several cameras, must be valid |
| cameraIndex | The index of the camera for which the gravity constraint will be extracted, with range [0, constraints.numberCameras() - 1] |
|
inline |
Creates a new gravity constraints object for a single camera from a given constraints object with several cameras.
The constructor will create an invalid object if the given constraints object is nullptr.
| constraints | The constraints object with several cameras, nullptr to create an invalid constraint object, must be valid if not nullptr |
| cameraIndex | The index of the camera for which the gravity constraint will be extracted, with range [0, constraints.numberCameras() - 1] |
| HomogenousMatrixT4< T > Ocean::Geometry::GravityConstraintsT< T >::alignCameraWithGravity | ( | const HomogenousMatrixT4< T > & | world_T_camera, |
| const size_t | cameraIndex = 0 |
||
| ) | const |
Rotates a camera pose so that the camera is aligned with the gravity constraints.
| world_T_camera | The transformation transforming camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the alignment will be performed, with range [0, numberCameras() - 1] |
| HomogenousMatrixT4< T > Ocean::Geometry::GravityConstraintsT< T >::alignCameraWithGravityIF | ( | const HomogenousMatrixT4< T > & | flippedCamera_T_world, |
| const size_t | cameraIndex = 0 |
||
| ) | const |
Rotates a inverted and flipped camera pose so that the flipped camera is aligned with the gravity constraints.
| flippedCamera_T_world | The transformation transforming world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the alignment will be performed, with range [0, numberCameras() - 1] |
|
inline |
Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian.
| world_T_camera | The transformation transforming camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the angle will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian.
| world_Q_camera | The rotation rotating camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the angle will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian.
| flippedCamera_T_world | The transformation transforming world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the angle will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian.
| flippedCamera_Q_world | The rotation rotating world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the angle will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian.
| world_T_camera | The transformation transforming camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the cosine will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system).
| world_Q_camera | The rotation rotating camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the cosine will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian.
| flippedCamera_T_world | The transformation transforming world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the cosine will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the cosine between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian.
| flippedCamera_Q_world | The rotation rotating world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the cosine will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns one possible rotation between world and camera.
The resulting rotation contains a remaining degree of freedom as the rotation is only based on the corresponding gravity vectors.
Any rotation around the gravity vector would be a valid rotation as well.
| cameraIndex | The index of the camera for which the rotation will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the camera gravity vectors (which are known for one or several camera poses) defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards.
|
static |
Helper function returning the camera gravity vector in the camera coordinate system based on a given camera pose and the world gravity vector.
The resulting camera gravity vector is obtained by converting the world gravity vector into the camera coordinate system.
| camera_T_world | The transformation transforming world to camera, with default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| worldGravityInWorld | The world gravity vector defined in the world coordinate system, must be a unit vector |
|
static |
Helper function returning the camera gravity vector in the camera coordinate system based on a given camera pose and the world gravity vector.
The resulting camera gravity vector is obtained by converting the world gravity vector into the camera coordinate system.
| camera_Q_world | The rotation rotating world to camera, with default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| worldGravityInWorld | The world gravity vector defined in the world coordinate system, must be a unit vector |
|
inline |
Returns the camera gravity vector (which is known for a camera pose), defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards.
| cameraIndex | The index of the camera for which the gravity vector is requested, with range [0, numberCameras() - 1] |
|
static |
Helper function returning the camera gravity vector in the camera coordinate system based on a given camera pose and the world gravity vector.
The resulting camera gravity vector is obtained by converting the world gravity vector into the camera coordinate system.,br> This function return the same gravity vector as cameraGravityInCamera(), but uses the flipped camera pose as input parameter.
| flippedCamera_T_world | The transformation transforming world to flipped camera, with default camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| worldGravityInWorld | The world gravity vector defined in the world coordinate system, must be a unit vector |
|
inline |
Returns the camera gravity vector (which is known for a camera pose), defined in the flipped camera coordinate system, with default flipped camera pointing towards the positive z-axis and y-axis pointing downwards.
| cameraIndex | The index of the camera for which the gravity vector is requested, with range [0, numberCameras() - 1] |
|
static |
Helper function returning the camera gravity vector in the flipped camera coordinate system based on a given camera pose and the world gravity vector.
The resulting camera gravity vector is obtained by converting the world gravity vector into the flipped camera coordinate system.
| flippedCamera_T_world | The transformation transforming world to flipped camera, with default camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| worldGravityInWorld | The world gravity vector defined in the world coordinate system, must be a unit vector |
|
inline |
Returns the camera gravity vector (which is known for a camera pose), defined in the world coordinate system.
| world_T_camera | The transformation transforming camera to world, with default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the gravity vector is requested, with range [0, numberCameras() - 1] |
|
inline |
Returns the camera gravity vector (which is known for a camera pose), defined in the world coordinate system.
| world_Q_camera | The rotation rotating camera to world, with default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the gravity vector is requested, with range [0, numberCameras() - 1] |
|
inline |
Returns the pointer to this gravity constraints object if it is valid.
| pointerIfValid | True, to return a pointer to this object if this object is valid; False, to always return a null pointer |
|
inline |
Returns one possible rotation between world and the flipped camera.
The resulting rotation contains a remaining degree of freedom as the rotation is only based on the corresponding gravity vectors.
Any rotation around the gravity vector would be a valid rotation as well.
| cameraIndex | The index of the camera for which the rotation will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns whether a camera pose is aligned with the gravity constraints using a custom angle threshold.
| world_T_camera | The transformation transforming camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
| maxAngle | The maximal angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian, with range [0, PI/2) |
|
inline |
Returns whether a camera pose is aligned with the gravity constraints using the specified angle threshold.
| world_T_camera | The transformation transforming camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
| bool Ocean::Geometry::GravityConstraintsT< T >::isCameraAlignedWithGravity | ( | const QuaternionT< T > & | world_Q_camera, |
| const size_t | cameraIndex, | ||
| const T | maxAngle | ||
| ) | const |
Returns whether a camera pose is aligned with the gravity constraints using a custom angle threshold.
| world_Q_camera | The rotation rotating camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
| maxAngle | The maximal angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian, with range [0, PI/2) |
| bool Ocean::Geometry::GravityConstraintsT< T >::isCameraAlignedWithGravity | ( | const QuaternionT< T > & | world_Q_camera, |
| const size_t | cameraIndex = 0 |
||
| ) | const |
Returns whether a camera pose is aligned with the gravity constraints using the specified angle threshold.
| world_Q_camera | The rotation rotating camera to world, with a default camera pointing towards the negative z-space and y-axis pointing upwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
|
inline |
Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using a custom angle threshold.
| flippedCamera_T_world | The transformation transforming world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
| maxAngle | The maximal angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian, with range [0, PI/2) |
|
inline |
Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using the specified angle threshold.
| flippedCamera_T_world | The transformation transforming world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
| maxAngle | The maximal angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian, with range [0, PI/2) |
| bool Ocean::Geometry::GravityConstraintsT< T >::isCameraAlignedWithGravityIF | ( | const QuaternionT< T > & | flippedCamera_Q_world, |
| const size_t | cameraIndex, | ||
| const T | maxAngle | ||
| ) | const |
Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using a custom angle threshold.
| flippedCamera_Q_world | The rotation rotating world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
| maxAngle | The maximal angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian, with range [0, PI/2) |
| bool Ocean::Geometry::GravityConstraintsT< T >::isCameraAlignedWithGravityIF | ( | const QuaternionT< T > & | flippedCamera_Q_world, |
| const size_t | cameraIndex = 0 |
||
| ) | const |
Returns whether a provided flipped and inverted camera pose is aligned with the gravity constraints using the specified angle threshold.
| flippedCamera_Q_world | The rotation rotating world to flipped camera, with a default flipped camera pointing towards the positive z-space and y-axis pointing downwards, must be valid |
| cameraIndex | The index of the camera for which the alignment check will be performed, with range [0, numberCameras() - 1] |
| maxAngle | The maximal angle between the world gravity vector and the camera gravity vector (after converting into the same coordinate system), in radian, with range [0, PI/2) |
|
inline |
Returns whether this constraint object holds valid parameters.
|
inline |
|
inline |
Returns the cosine value of maximalAngle().
|
inline |
Returns the number of cameras for which gravity constraints are defined.
|
inline |
Returns the weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a normal/default gravity correction, larger values to apply a stronger gravity correction.
|
inline |
Returns one possible rotation between camera and world.
The resulting rotation contains a remaining degree of freedom as the rotation is only based on the corresponding gravity vectors.
Any rotation around the gravity vector would be a valid rotation as well.
| cameraIndex | The index of the camera for which the rotation will be returned, with range [0, numberCameras() - 1] |
|
inline |
Returns the world gravity vector defined in the flipped camera coordinate system, with default flipped camera pointing towards the positive z-axis and y-axis pointing downwards.
| flippedCamera_T_world | The transformation transforming world to flipped camera, must be valid |
|
inline |
Returns the world gravity vector defined in the flipped camera coordinate system, with default flipped camera pointing towards the positive z-axis and y-axis pointing downwards.
| flippedCamera_Q_world | The rotation rotating world to flipped camera, must be valid |
|
inline |
Returns the world gravity vector defined in the world coordinate system.
|
protected |
The gravity vectors which are known for one or more camera poses, defined in the camera coordinate system, with default camera pointing towards the negative z-space and y-axis pointing upwards.
|
protected |
|
protected |
The cosine value of maximalAngle(), with range [0, 1].
|
protected |
The weight factor to be used during a non-linear optimization of a camera pose; 0 to skip any gravity correction, 1 to apply a full gravity correction; with range [0, 1).
|
protected |
The world gravity vector defined in the world coordinate system, mainly defining how the world coordinate system is oriented/aligned wrt gravity.