Class Rotation

Class Documentation

class Rotation

Implementation of the extrinsic camera rotation.

Public Functions

inline explicit Rotation()

Zero initialization constructor.

This will initialize a zero rotation, i.e. identity rotation matrix.

inline explicit Rotation(const cv::Matx33d &RMat)

Initialization constructor, initializing rotation of the camera by providing a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}}\).

inline explicit Rotation(const cv::Vec3d &rodriguesVec)

Initialization constructor, initializing rotation of the camera by providing the rodrigues vector.

inline explicit Rotation(const cv::Mat &vecOrMat)

Initialization constructor, initializing rotation of the camera by either providing a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}}\) or the rodrigues vector.

Parameters:

vecOrMat[in] Rodrigues Vector or Rotation matrix. Thus vecOrMat needs to be of size \(3\times 3\) or \(3\times 1\) or \(1\times 3\)

inline Rotation(const Rotation &rhs)

Copy constructor.

inline Rotation(Rotation &&rhs)

Move constructor.

inline Rotation &operator=(const Rotation &rhs)

Copy assignment operator.

inline Rotation &operator=(Rotation &&rhs)

Move assignment operator.

inline bool operator==(const Rotation &rhs)

Comparison operator.

Returns:

True, if both \(\mathrm{\mathbb{R}}\) and the rodrigues vector of two rotation objects are equal.

inline bool operator!=(const Rotation &rhs)

Comparison operator.

Returns:

True, if both \(\mathrm{\mathbb{R}}\) or the rodrigues vector of two rotation objects are Not the same.

inline Rotation &operator*=(const Rotation &rhs)

Multiply and assing operator. Allows to add a rotation to existing object.

inline cv::Matx33d getRMat() const

Returns the \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}}\).

inline cv::Vec3d getRodriguesVec() const

Returns Rodrigues vector.

inline void setRMat(const cv::Matx33d &R)

Set the extrinsic camera rotation by providing a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}}\).

inline void setRMat(const cv::Mat &R)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

inline void setRodriguesVec(const cv::Vec3d &rodrigues)

Set the extrinsic camera rotation by providing the Rodrigues vector.

inline void setRodriguesVec(const cv::Mat &rodrigues)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Public Static Functions

static inline cv::Matx33d createRotationX_rad(const double angleRad)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}_x}\) which rotates by a given angle around the X-Axis.

Parameters:

angleRad[in] Angle to rotate in radians.

static inline cv::Matx33d createRotationY_rad(const double angleRad)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}_y}\) which rotates by a given angle around the Y-Axis.

Parameters:

angleRad[in] Angle to rotate in radians.

static inline cv::Matx33d createRotationZ_rad(const double angleRad)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}_z}\) which rotates by a given angle around the Z-Axis.

Parameters:

angleRad[in] Angle to rotate in radians.

static inline cv::Matx33d createRotationX_deg(const double angleDeg)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}_x}\) which rotates by a given angle around the X-Axis.

Parameters:

angleDeg[in] Angle to rotate in degrees.

static inline cv::Matx33d createRotationY_deg(const double angleDeg)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}_y}\) which rotates by a given angle around the Y-Axis.

Parameters:

angleDeg[in] Angle to rotate in degrees.

static inline cv::Matx33d createRotationZ_deg(const double angleDeg)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}_z}\) which rotates by a given angle around the Z-Axis.

Parameters:

angleDeg[in] Angle to rotate in degrees.

static inline cv::Matx33d createRotationXYZ_rad(const double xRad, const double yRad, const double zRad)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}}\) which rotates by a given angles around the X-, Y- and Z-Axis.

Parameters:
  • xRad[in] Angle to rotate around X-Axis in Radians.

  • yRad[in] Angle to rotate around Y-Axis in Radians.

  • zRad[in] Angle to rotate around Z-Axis in Radians.

static inline cv::Matx33d createRotationXYZ_deg(const double xDeg, const double yDeg, const double zDeg)

Method to create a \(3\times 3\) rotation matrix \(\mathrm{\mathbf{R}}\) which rotates by a given angles around the X-, Y- and Z-Axis.

Parameters:
  • xDeg[in] Angle to rotate around X-Axis in Degrees.

  • yDeg[in] Angle to rotate around Y-Axis in Degrees.

  • zDeg[in] Angle to rotate around Z-Axis in Degrees.

Friends

inline friend Rotation operator*(Rotation lhs, const Rotation &rhs)

Multiply operator. Allows to add tow rotation objects.