Eigen support#
Detailed Description#
These functions are provided for OpenCV-Eigen interoperability. They convert Mat objects to corresponding Eigen::Matrix objects and vice-versa. Consult the Eigen documentation for information about the Matrix template type.
Note
Using these functions requires the Eigen/Dense or similar header to be included before this header.
Namespaces#
Classes#
Name |
Description |
|---|---|
Affine transform. View details |
Typedef Documentation#
Affine3d#
typedef Affine3< double > cv::Affine3d
#include <opencv2/core/affine.hpp>
Affine3f#
typedef Affine3< float > cv::Affine3f
#include <opencv2/core/affine.hpp>
Function Documentation#
cv2eigen() [1/11]#
template<typename _Tp>
static inline void cv::cv2eigen(
const Mat & src,
Eigen::Matrix< _Tp, 1, Eigen::Dynamic > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [2/11]#
template<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols>
static inline void cv::cv2eigen(
const Mat & src,
Eigen::Matrix< _Tp, _rows, _cols, _options, _maxRows, _maxCols > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [3/11]#
template<typename _Tp>
static inline void cv::cv2eigen(
const Mat & src,
Eigen::Matrix< _Tp, Eigen::Dynamic, 1 > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [4/11]#
template<typename _Tp>
static inline void cv::cv2eigen(
const Mat & src,
Eigen::Matrix< _Tp, Eigen::Dynamic, Eigen::Dynamic > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [5/11]#
template<typename _Tp>
static inline void cv::cv2eigen(
const Mat & src,
Eigen::Matrix< _Tp, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [6/11]#
template<typename _Tp, int _layout>
static inline void cv::cv2eigen(
const Mat & src,
Eigen::Tensor< _Tp, 3, _layout > & dst )
#include <opencv2/core/eigen.hpp>
Converts a cv::Mat to an Eigen::Tensor.
The method converts a cv::Mat to an Eigen Tensor with shape (H x W x C) where: H = number of rows W = number of columns C = number of channels
Usage:
Here is the call graph for this function:
cv2eigen() [7/11]#
template<typename _Tp, int _cols>
static inline void cv::cv2eigen(
const Matx< _Tp, 1, _cols > & src,
Eigen::Matrix< _Tp, 1, Eigen::Dynamic > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [8/11]#
template<typename _Tp, int _rows>
static inline void cv::cv2eigen(
const Matx< _Tp, _rows, 1 > & src,
Eigen::Matrix< _Tp, Eigen::Dynamic, 1 > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [9/11]#
template<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols>
static inline void cv::cv2eigen(
const Matx< _Tp, _rows, _cols > & src,
Eigen::Matrix< _Tp, _rows, _cols, _options, _maxRows, _maxCols > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [10/11]#
template<typename _Tp, int _rows, int _cols>
static inline void cv::cv2eigen(
const Matx< _Tp, _rows, _cols > & src,
Eigen::Matrix< _Tp, Eigen::Dynamic, Eigen::Dynamic > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen() [11/11]#
template<typename _Tp, int _rows, int _cols>
static inline void cv::cv2eigen(
const Matx< _Tp, _rows, _cols > & src,
Eigen::Matrix< _Tp, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
cv2eigen_tensormap()#
template<typename _Tp>
static inline Eigen::TensorMap< Eigen::Tensor< _Tp, 3, Eigen::RowMajor > > cv::cv2eigen_tensormap(InputArray src)
#include <opencv2/core/eigen.hpp>
Maps cv::Mat data to an Eigen::TensorMap.
The method wraps an existing Mat data array with an Eigen TensorMap of shape (H x W x C) where: H = number of rows W = number of columns C = number of channels
Explicit instantiation of the return type is required.
Note
Caller should be aware of the lifetime of the cv::Mat instance and take appropriate safety measures. The cv::Mat instance will retain ownership of the data and the Eigen::TensorMap will lose access when the cv::Mat data is deallocated.
The example below initializes a cv::Mat and produces an Eigen::TensorMap:
float arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
Mat a_mat(2, 2, CV_32FC3, arr);
Eigen::TensorMap<Eigen::Tensor<float, 3, Eigen::RowMajor>> a_tensormap = cv2eigen_tensormap<float>(a_mat);
Here is the call graph for this function:
eigen2cv() [1/3]#
template<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols>
static inline void cv::eigen2cv(
const Eigen::Matrix< _Tp, _rows, _cols, _options, _maxRows, _maxCols > & src,
Matx< _Tp, _rows, _cols > & dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
eigen2cv() [2/3]#
template<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols>
static inline void cv::eigen2cv(
const Eigen::Matrix< _Tp, _rows, _cols, _options, _maxRows, _maxCols > & src,
OutputArray dst )
#include <opencv2/core/eigen.hpp>
Here is the call graph for this function:
eigen2cv() [3/3]#
template<typename _Tp, int _layout>
static inline void cv::eigen2cv(
const Eigen::Tensor< _Tp, 3, _layout > & src,
OutputArray dst )
#include <opencv2/core/eigen.hpp>
Converts an Eigen::Tensor to a cv::Mat.
The method converts an Eigen::Tensor with shape (H x W x C) to a cv::Mat where: H = number of rows W = number of columns C = number of channels
Usage:
Here is the call graph for this function:
operator*() [1/4]#
template<typename T, typename V>
static V cv::operator*(
const Affine3< T > & affine,
const V & vector )
#include <opencv2/core/affine.hpp>
V is a 3-element vector with member fields x, y and z.
operator*() [2/4]#
template<typename T>
static Affine3< T > cv::operator*(
const Affine3< T > & affine1,
const Affine3< T > & affine2 )
#include <opencv2/core/affine.hpp>
operator*() [3/4]#
static Vec3d cv::operator*(
const Affine3d & affine,
const Vec3d & vector )
#include <opencv2/core/affine.hpp>
operator*() [4/4]#
static Vec3f cv::operator*(
const Affine3f & affine,
const Vec3f & vector )
#include <opencv2/core/affine.hpp>