From: Maria Dimashova Date: Sun, 11 Mar 2012 11:45:29 +0000 (+0000) Subject: fixed compilation with eigen2 X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~5396 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90f6e319dac1d59a6a03ae791784bc0e860961d3;p=platform%2Fupstream%2Fopencv.git fixed compilation with eigen2 --- diff --git a/modules/contrib/src/rgbdodometry.cpp b/modules/contrib/src/rgbdodometry.cpp index decca23..e7608ee 100644 --- a/modules/contrib/src/rgbdodometry.cpp +++ b/modules/contrib/src/rgbdodometry.cpp @@ -47,9 +47,9 @@ #include -#ifdef HAVE_EIGEN +#if defined(HAVE_EIGEN) && EIGEN_WORLD_VERSION == 3 #include -//#include +#include #include #endif @@ -77,18 +77,18 @@ void computeProjectiveMatrix( const Mat& ksi, Mat& Rt ) { CV_Assert( ksi.size() == Size(1,6) && ksi.type() == CV_64FC1 ); -//#ifdef HAVE_EIGEN -// const double* ksi_ptr = reinterpret_cast(ksi.ptr(0)); -// Eigen::Matrix twist, g; -// twist << 0., -ksi_ptr[2], ksi_ptr[1], ksi_ptr[3], -// ksi_ptr[2], 0., -ksi_ptr[0], ksi_ptr[4], -// -ksi_ptr[1], ksi_ptr[0], 0, ksi_ptr[5], -// 0., 0., 0., 0.; -// g = twist.exp(); +#if defined(HAVE_EIGEN) && EIGEN_WORLD_VERSION == 3 + const double* ksi_ptr = reinterpret_cast(ksi.ptr(0)); + Eigen::Matrix twist, g; + twist << 0., -ksi_ptr[2], ksi_ptr[1], ksi_ptr[3], + ksi_ptr[2], 0., -ksi_ptr[0], ksi_ptr[4], + -ksi_ptr[1], ksi_ptr[0], 0, ksi_ptr[5], + 0., 0., 0., 0.; + g = twist.exp(); -// eigen2cv(g, Rt); -//#else + eigen2cv(g, Rt); +#else // for infinitesimal transformation Rt = Mat::eye(4, 4, CV_64FC1); @@ -100,7 +100,7 @@ void computeProjectiveMatrix( const Mat& ksi, Mat& Rt ) Rt.at(0,3) = ksi.at(3); Rt.at(1,3) = ksi.at(4); Rt.at(2,3) = ksi.at(5); -//#endif +#endif } static @@ -286,7 +286,7 @@ static bool solveSystem( const Mat& C, const Mat& dI_dt, double detThreshold, Mat& Rt ) { Mat ksi; -#ifdef HAVE_EIGEN +#if defined(HAVE_EIGEN) && EIGEN_WORLD_VERSION == 3 Eigen::Matrix eC, eCt, edI_dt; cv2eigen(C, eC); cv2eigen(dI_dt, edI_dt);