mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
fixed compilation with eigen2
This commit is contained in:
parent
532781e8d2
commit
abe2c2fb3f
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_EIGEN
|
#ifdef HAVE_EIGEN
|
||||||
#include <Eigen/Core>
|
#include <Eigen/Core>
|
||||||
#include <unsupported/Eigen/MatrixFunctions>
|
//#include <unsupported/Eigen/MatrixFunctions>
|
||||||
|
|
||||||
#include <Eigen/Dense>
|
#include <Eigen/Dense>
|
||||||
#endif
|
#endif
|
||||||
@ -77,18 +77,18 @@ void computeProjectiveMatrix( const Mat& ksi, Mat& Rt )
|
|||||||
{
|
{
|
||||||
CV_Assert( ksi.size() == Size(1,6) && ksi.type() == CV_64FC1 );
|
CV_Assert( ksi.size() == Size(1,6) && ksi.type() == CV_64FC1 );
|
||||||
|
|
||||||
#ifdef HAVE_EIGEN
|
//#ifdef HAVE_EIGEN
|
||||||
const double* ksi_ptr = reinterpret_cast<const double*>(ksi.ptr(0));
|
// const double* ksi_ptr = reinterpret_cast<const double*>(ksi.ptr(0));
|
||||||
Eigen::Matrix<double,4,4> twist, g;
|
// Eigen::Matrix<double,4,4> twist, g;
|
||||||
twist << 0., -ksi_ptr[2], ksi_ptr[1], ksi_ptr[3],
|
// twist << 0., -ksi_ptr[2], ksi_ptr[1], ksi_ptr[3],
|
||||||
ksi_ptr[2], 0., -ksi_ptr[0], ksi_ptr[4],
|
// ksi_ptr[2], 0., -ksi_ptr[0], ksi_ptr[4],
|
||||||
-ksi_ptr[1], ksi_ptr[0], 0, ksi_ptr[5],
|
// -ksi_ptr[1], ksi_ptr[0], 0, ksi_ptr[5],
|
||||||
0., 0., 0., 0.;
|
// 0., 0., 0., 0.;
|
||||||
g = twist.exp();
|
// g = twist.exp();
|
||||||
|
|
||||||
|
|
||||||
eigen2cv(g, Rt);
|
// eigen2cv(g, Rt);
|
||||||
#else
|
//#else
|
||||||
// for infinitesimal transformation
|
// for infinitesimal transformation
|
||||||
Rt = Mat::eye(4, 4, CV_64FC1);
|
Rt = Mat::eye(4, 4, CV_64FC1);
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ void computeProjectiveMatrix( const Mat& ksi, Mat& Rt )
|
|||||||
Rt.at<double>(0,3) = ksi.at<double>(3);
|
Rt.at<double>(0,3) = ksi.at<double>(3);
|
||||||
Rt.at<double>(1,3) = ksi.at<double>(4);
|
Rt.at<double>(1,3) = ksi.at<double>(4);
|
||||||
Rt.at<double>(2,3) = ksi.at<double>(5);
|
Rt.at<double>(2,3) = ksi.at<double>(5);
|
||||||
#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
Loading…
Reference in New Issue
Block a user