NDEVR
API Documentation
Converter

Utility class for converting between OpenCV, Eigen, Sophus, and NDEVR matrix types. More...

Static Public Member Functions

static bool isRotationMatrix (const cv::Mat &R)
 Checks whether a given matrix is a valid rotation matrix.
static cv::Mat toCvMat (const Eigen::Matrix< double, -1, -1 > &m)
 Converts a dynamic-size double Eigen matrix to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< double, 3, 1 > &m)
 Converts a 3x1 double Eigen vector to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< double, 3, 3 > &m)
 Converts a 3x3 double Eigen matrix to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< double, 4, 4 > &m)
 Converts a 4x4 double Eigen matrix to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< float, -1, -1 > &m)
 Converts a dynamic-size float Eigen matrix to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< float, 3, 1 > &m)
 Converts a 3x1 float Eigen vector to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< float, 3, 3 > &m)
 Converts a 3x3 float Eigen matrix to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< float, 3, 4 > &m)
 Converts a 3x4 float Eigen matrix to OpenCV Mat.
static cv::Mat toCvMat (const Eigen::Matrix< float, 4, 4 > &m)
 Converts a 4x4 float Eigen matrix to OpenCV Mat.
static cv::Mat toCvMat (const SE3Quat &SE3)
 Converts an SE3Quat to an OpenCV 4x4 Mat.
static cv::Mat toCvMat (const Sim3 &Sim3)
 Converts a Sim3 to an OpenCV 4x4 Mat.
static cv::Mat toCvSE3 (const Eigen::Matrix< double, 3, 3 > &R, const Eigen::Matrix< double, 3, 1 > &t)
 Builds a 4x4 SE3 OpenCV Mat from a rotation and translation (double).
static cv::Mat toCvSE3 (const Eigen::Matrix< fltp04, 3, 3 > &R, const Eigen::Matrix< fltp04, 3, 1 > &t)
 Builds a 4x4 SE3 OpenCV Mat from a rotation and translation (float).
static cv::Mat tocvSkewMatrix (const cv::Mat &v)
 Converts a 3-vector to a skew-symmetric matrix.
static Buffer< cv::Mat, BufferAllocator< cv::Mat, 64, false > > toDescriptorVector (const cv::Mat &Descriptors)
 Converts a descriptor matrix into a buffer of individual row descriptors.
static Buffer< float > toEuler (const cv::Mat &R)
 Converts a rotation matrix to Euler angles.
static Eigen::Matrix< double, 3, 3 > toMatrix3d (const cv::Mat &cvMat3)
 Converts an OpenCV 3x3 Mat to a double Eigen matrix.
static Eigen::Matrix< float, 3, 3 > toMatrix3f (const cv::Mat &cvMat3)
 Converts an OpenCV 3x3 Mat to a float Eigen matrix.
static Eigen::Matrix< double, 4, 4 > toMatrix4d (const cv::Mat &cvMat4)
 Converts an OpenCV 4x4 Mat to a double Eigen matrix.
static Eigen::Matrix< float, 4, 4 > toMatrix4f (const cv::Mat &cvMat4)
 Converts an OpenCV 4x4 Mat to a float Eigen matrix.
static Matrix< fltp04ToNDVMat (const Eigen::Matrix< float, 4, 4 > &m)
 Converts a 4x4 float Eigen matrix to an NDEVR Matrix.
static SE3Quat toSE3Quat (const cv::Mat &cvT)
 Converts an OpenCV 4x4 transform to SE3Quat.
static SE3Quat toSE3Quat (const Sim3 &gSim3)
 Converts a Sim3 to SE3Quat (discards scale).
static SE3Quat toSE3Quat (const Sophus::SE3< float, 0 > &T)
 Converts a Sophus SE3 to SE3Quat.
static Sophus::SE3< g_type, 0 > toSophus (const cv::Mat &T)
 Converts an OpenCV 4x4 Mat to a Sophus SE3.
static Sophus::Sim3< g_type, 0 > toSophus (const Sim3 &S)
 Converts an NDEVR Sim3 to a Sophus Sim3.
static Eigen::Matrix< double, 3, 1 > toVector3d (const cv::Mat &cvVector)
 Converts an OpenCV Mat to a 3D double Eigen vector.
static Eigen::Matrix< double, 3, 1 > toVector3d (const cv::Point3_< float > &scvPoint)
 Converts an OpenCV Point3f to a 3D double Eigen vector.
static Eigen::Matrix< float, 3, 1 > toVector3f (const cv::Mat &cvVector)
 Converts an OpenCV Mat to a 3D float Eigen vector.

Detailed Description

Utility class for converting between OpenCV, Eigen, Sophus, and NDEVR matrix types.

Provides static methods for converting poses, rotation matrices, and vectors between the different linear algebra representations used throughout the SLAM system.

Definition at line 29 of file Converter.h.

Member Function Documentation

◆ isRotationMatrix()

bool Converter::isRotationMatrix ( const cv::Mat & R)
static

Checks whether a given matrix is a valid rotation matrix.

Parameters
[in]RThe matrix to check.
Returns
True if R is a proper rotation matrix.

◆ toCvMat() [1/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< double, -1, -1 > & m)
static

Converts a dynamic-size double Eigen matrix to OpenCV Mat.

Parameters
[in]mThe Eigen matrix.
Returns
The OpenCV matrix.

◆ toCvMat() [2/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< double, 3, 1 > & m)
static

Converts a 3x1 double Eigen vector to OpenCV Mat.

Parameters
[in]mThe Eigen vector.
Returns
The OpenCV matrix.

◆ toCvMat() [3/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< double, 3, 3 > & m)
static

Converts a 3x3 double Eigen matrix to OpenCV Mat.

Parameters
[in]mThe Eigen matrix.
Returns
The OpenCV matrix.

◆ toCvMat() [4/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< double, 4, 4 > & m)
static

Converts a 4x4 double Eigen matrix to OpenCV Mat.

Parameters
[in]mThe Eigen matrix.
Returns
The OpenCV matrix.

◆ toCvMat() [5/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< float, -1, -1 > & m)
static

Converts a dynamic-size float Eigen matrix to OpenCV Mat.

Parameters
[in]mThe Eigen matrix.
Returns
The OpenCV matrix.

◆ toCvMat() [6/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< float, 3, 1 > & m)
static

Converts a 3x1 float Eigen vector to OpenCV Mat.

Parameters
[in]mThe Eigen vector.
Returns
The OpenCV matrix.

◆ toCvMat() [7/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< float, 3, 3 > & m)
static

Converts a 3x3 float Eigen matrix to OpenCV Mat.

Parameters
[in]mThe Eigen matrix.
Returns
The OpenCV matrix.

◆ toCvMat() [8/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< float, 3, 4 > & m)
static

Converts a 3x4 float Eigen matrix to OpenCV Mat.

Parameters
[in]mThe Eigen matrix.
Returns
The OpenCV matrix.

◆ toCvMat() [9/11]

cv::Mat Converter::toCvMat ( const Eigen::Matrix< float, 4, 4 > & m)
static

Converts a 4x4 float Eigen matrix to OpenCV Mat.

Parameters
[in]mThe Eigen matrix.
Returns
The OpenCV matrix.

◆ toCvMat() [10/11]

cv::Mat Converter::toCvMat ( const SE3Quat & SE3)
static

Converts an SE3Quat to an OpenCV 4x4 Mat.

Parameters
[in]SE3The SE3Quat pose.
Returns
The 4x4 OpenCV matrix.

◆ toCvMat() [11/11]

cv::Mat Converter::toCvMat ( const Sim3 & Sim3)
static

Converts a Sim3 to an OpenCV 4x4 Mat.

Parameters
[in]Sim3The Sim3 transform.
Returns
The 4x4 OpenCV matrix.

◆ toCvSE3() [1/2]

cv::Mat Converter::toCvSE3 ( const Eigen::Matrix< double, 3, 3 > & R,
const Eigen::Matrix< double, 3, 1 > & t )
static

Builds a 4x4 SE3 OpenCV Mat from a rotation and translation (double).

Parameters
[in]RThe 3x3 rotation matrix.
[in]tThe 3x1 translation vector.
Returns
The 4x4 SE3 matrix.

◆ toCvSE3() [2/2]

cv::Mat Converter::toCvSE3 ( const Eigen::Matrix< fltp04, 3, 3 > & R,
const Eigen::Matrix< fltp04, 3, 1 > & t )
static

Builds a 4x4 SE3 OpenCV Mat from a rotation and translation (float).

Parameters
[in]RThe 3x3 rotation matrix.
[in]tThe 3x1 translation vector.
Returns
The 4x4 SE3 matrix.

◆ tocvSkewMatrix()

cv::Mat Converter::tocvSkewMatrix ( const cv::Mat & v)
static

Converts a 3-vector to a skew-symmetric matrix.

Parameters
[in]vThe 3x1 vector.
Returns
The 3x3 skew-symmetric matrix.

◆ toDescriptorVector()

Buffer< cv::Mat, BufferAllocator< cv::Mat, 64, false > > Converter::toDescriptorVector ( const cv::Mat & Descriptors)
static

Converts a descriptor matrix into a buffer of individual row descriptors.

Parameters
[in]DescriptorsThe OpenCV descriptor matrix.
Returns
Buffer of single-row descriptor matrices.

◆ toEuler()

Buffer< float > Converter::toEuler ( const cv::Mat & R)
static

Converts a rotation matrix to Euler angles.

Parameters
[in]RThe 3x3 rotation matrix.
Returns
Buffer of three Euler angles.

◆ toMatrix3d()

Eigen::Matrix< double, 3, 3 > Converter::toMatrix3d ( const cv::Mat & cvMat3)
static

Converts an OpenCV 3x3 Mat to a double Eigen matrix.

Parameters
[in]cvMat3The 3x3 OpenCV matrix.
Returns
The Eigen matrix.

◆ toMatrix3f()

Eigen::Matrix< float, 3, 3 > Converter::toMatrix3f ( const cv::Mat & cvMat3)
static

Converts an OpenCV 3x3 Mat to a float Eigen matrix.

Parameters
[in]cvMat3The 3x3 OpenCV matrix.
Returns
The Eigen matrix.

◆ toMatrix4d()

Eigen::Matrix< double, 4, 4 > Converter::toMatrix4d ( const cv::Mat & cvMat4)
static

Converts an OpenCV 4x4 Mat to a double Eigen matrix.

Parameters
[in]cvMat4The 4x4 OpenCV matrix.
Returns
The Eigen matrix.

◆ toMatrix4f()

Eigen::Matrix< float, 4, 4 > Converter::toMatrix4f ( const cv::Mat & cvMat4)
static

Converts an OpenCV 4x4 Mat to a float Eigen matrix.

Parameters
[in]cvMat4The 4x4 OpenCV matrix.
Returns
The Eigen matrix.

◆ ToNDVMat()

Matrix< fltp04 > Converter::ToNDVMat ( const Eigen::Matrix< float, 4, 4 > & m)
inlinestatic

Converts a 4x4 float Eigen matrix to an NDEVR Matrix.

Parameters
[in]mThe Eigen matrix.
Returns
The NDEVR matrix.

Definition at line 105 of file Converter.h.

References cast().

◆ toSE3Quat() [1/3]

SE3Quat Converter::toSE3Quat ( const cv::Mat & cvT)
static

Converts an OpenCV 4x4 transform to SE3Quat.

Parameters
[in]cvTThe 4x4 transformation matrix.
Returns
The SE3Quat representation.

◆ toSE3Quat() [2/3]

SE3Quat Converter::toSE3Quat ( const Sim3 & gSim3)
static

Converts a Sim3 to SE3Quat (discards scale).

Parameters
[in]gSim3The Sim3 transform.
Returns
The SE3Quat representation.

◆ toSE3Quat() [3/3]

SE3Quat Converter::toSE3Quat ( const Sophus::SE3< float, 0 > & T)
static

Converts a Sophus SE3 to SE3Quat.

Parameters
[in]TThe Sophus SE3 pose.
Returns
The SE3Quat representation.

◆ toSophus() [1/2]

Sophus::SE3< g_type, 0 > Converter::toSophus ( const cv::Mat & T)
static

Converts an OpenCV 4x4 Mat to a Sophus SE3.

Parameters
[in]TThe 4x4 transformation matrix.
Returns
The Sophus SE3 representation.

◆ toSophus() [2/2]

Sophus::Sim3< g_type, 0 > Converter::toSophus ( const Sim3 & S)
static

Converts an NDEVR Sim3 to a Sophus Sim3.

Parameters
[in]SThe NDEVR Sim3 transform.
Returns
The Sophus Sim3 representation.

◆ toVector3d() [1/2]

Eigen::Matrix< double, 3, 1 > Converter::toVector3d ( const cv::Mat & cvVector)
static

Converts an OpenCV Mat to a 3D double Eigen vector.

Parameters
[in]cvVectorThe OpenCV vector.
Returns
The Eigen 3D vector.

◆ toVector3d() [2/2]

Eigen::Matrix< double, 3, 1 > Converter::toVector3d ( const cv::Point3_< float > & scvPoint)
static

Converts an OpenCV Point3f to a 3D double Eigen vector.

Parameters
[in]scvPointThe OpenCV point.
Returns
The Eigen 3D vector.

◆ toVector3f()

Eigen::Matrix< float, 3, 1 > Converter::toVector3f ( const cv::Mat & cvVector)
static

Converts an OpenCV Mat to a 3D float Eigen vector.

Parameters
[in]cvVectorThe OpenCV vector.
Returns
The Eigen 3D vector.

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