added Eigen2 support; fixed compile errors on Ubuntu 10.04
authorVadim Pisarevsky <no@email>
Tue, 29 Jun 2010 15:49:15 +0000 (15:49 +0000)
committerVadim Pisarevsky <no@email>
Tue, 29 Jun 2010 15:49:15 +0000 (15:49 +0000)
CMakeLists.txt
cvconfig.h.cmake
modules/core/include/opencv2/core/core.hpp
modules/core/include/opencv2/core/internal.hpp
modules/core/include/opencv2/core/operations.hpp

index 50e1bbd..9ca5dd9 100644 (file)
@@ -280,6 +280,7 @@ if(APPLE)
 endif()\r
 \r
 set(WITH_TBB OFF CACHE BOOL "Include TBB support")\r
+set(WITH_EIGEN2 OFF CACHE BOOL "Include Eigen2 support")\r
 \r
 # ===================================================\r
 # Macros that checks if module have been installed.\r
@@ -347,7 +348,7 @@ if(UNIX)
     \r
     if(WITH_PVAPI)\r
       find_path(PVAPI_INCLUDE_PATH "PvApi.h"\r
-                PATHS "/usr/include" "/usr/local/include"\r
+                PATHS "/usr/local/include" "/usr/include"\r
                 DOC "The path to PvAPI header")\r
       if(PVAPI_INCLUDE_PATH)\r
         set(HAVE_PVAPI 1)\r
@@ -557,8 +558,8 @@ if (WITH_TBB)
     endif()        \r
     if (APPLE)\r
         set(TBB_DEFAULT_INCLUDE_DIRS\r
-          "/usr/include"\r
-          "/usr/local/include")  \r
+          "/usr/local/include"\r
+          "/usr/include")  \r
     endif() \r
     if (WIN32)\r
         set(TBB_DEFAULT_INCLUDE_DIRS\r
@@ -624,6 +625,19 @@ if (WITH_TBB)
     endif()\r
 endif()\r
 \r
+\r
+############################## Eigen2 ##############################\r
+\r
+if(WITH_EIGEN2)\r
+       find_path(EIGEN2_INCLUDE_PATH "Eigen/Core"\r
+            PATHS "/usr/local/include/eigen2" "/opt/include/eigen2" "/usr/include/eigen2"\r
+            DOC "The path to Eigen2 headers")\r
+    if(EIGEN2_INCLUDE_PATH)\r
+        include_directories(${EIGEN2_INCLUDE_PATH})\r
+        set(HAVE_EIGEN2 1)\r
+    endif()\r
+endif()\r
+\r
 ############################### IPP ################################\r
 set(IPP_FOUND)\r
 set(OPENCV_LOADER_PATH)\r
@@ -1251,6 +1265,12 @@ else()
 message(STATUS "    Use TBB:                   NO")\r
 endif()\r
 \r
+if(HAVE_EIGEN2)\r
+message(STATUS "    Use Eigen2:                YES")\r
+else()\r
+message(STATUS "    Use Eigen2:                NO")\r
+endif()\r
+\r
 message(STATUS "")\r
 message(STATUS "  Documentation: ")\r
 \r
index f77d5fe..6443622 100644 (file)
 #cmakedefine  WORDS_BIGENDIAN
 
 /* Intel Threading Building Blocks */
-#cmakedefine  HAVE_TBB
\ No newline at end of file
+#cmakedefine  HAVE_TBB
+
+/* Eigen2 Matrix & Linear Algebra Library */
+#cmakedefine  HAVE_EIGEN2
index a51e3c7..5e39e83 100644 (file)
@@ -566,7 +566,7 @@ public:
     static Matx eye();
     static Matx diag(const Vec<_Tp, MIN(m,n)>& d);
     static Matx randu(_Tp a, _Tp b);
-    static Matx randn(_Tp m, _Tp sigma);
+    static Matx randn(_Tp a, _Tp b);
     
     //! convertion to another data type
     template<typename T2> operator Matx<T2, m, n>() const;
@@ -575,7 +575,7 @@ public:
     template<int m1, int n1> Matx<_Tp, m1, n1> reshape() const;
     
     //! extract part of the matrix
-    template<int m1, int n1> Matx<_Tp, m1, n1> minor(int i, int j) const;
+    template<int m1, int n1> Matx<_Tp, m1, n1> get_minor(int i, int j) const;
     
     //! extract the matrix row
     Matx<_Tp, 1, n> row(int i) const;
index 5f4d164..244dbc3 100644 (file)
@@ -134,6 +134,10 @@ CV_INLINE IppiSize ippiSize(int width, int height)
     #endif
 #endif
 
+#ifdef HAVE_EIGEN2
+    #include "opencv2/core/eigen.hpp"
+#endif
+
 #ifdef __cplusplus
 
 #ifdef HAVE_TBB
index e762756..22651db 100644 (file)
@@ -734,7 +734,7 @@ Matx<_Tp, m1, n1> Matx<_Tp, m, n>::reshape() const
 
 template<typename _Tp, int m, int n>
 template<int m1, int n1> inline
-Matx<_Tp, m1, n1> Matx<_Tp, m, n>::minor(int i, int j) const
+Matx<_Tp, m1, n1> Matx<_Tp, m, n>::get_minor(int i, int j) const
 {
     CV_DbgAssert(0 <= i && i+m1 <= m && 0 <= j && j+n1 <= n);
     Matx<_Tp, m1, n1> s;