Unable to run programs of SFM (Structure From Motion) module

asked 2017-06-12 01:38:20 -0500

lohachan0108 gravatar image

updated 2017-06-14 00:40:19 -0500

LBerger gravatar image

I am getting an error when I am trying to execute a sample code in SFM module. Initially SFM was not present in my contrib directory. So i downloaded the latest contrib and pasted the sfm folder in my contrib directory. I used the CMakeLists.txt that was present in the sfm module. Then I tried to build it in my own directory with scene_reconstruction.cpp and the CMakeLists.txt which I took from the sfm module. Following is the error which I am getting

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.2.92 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Performing Test GFLAGS_IN_GOOGLE_NAMESPACE
-- Performing Test GFLAGS_IN_GOOGLE_NAMESPACE - Success
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.13.0 installed in: /usr/local with components: [LAPACK, SuiteSparse, SparseLinearAlgebraLibrary, CXSparse, SchurSpecializations, OpenMP]
-- Checking SFM deps... TRUE
-- Module opencv_sfm disabled because the following dependencies are not found: Eigen
CMake Error at CMakeLists.txt:35 (ocv_module_disable):
  Unknown CMake command "ocv_module_disable".
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as
cmake_minimum_required(VERSION 3.5)
  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

PS: I went through all the required downloads of the libraries mentioned in the SFM documentation page before starting off.

edit retag flag offensive close merge delete

Comments

If you want to use opencv_contrib you have to clone lastest opencv version from github

LBerger gravatar imageLBerger ( 2017-06-12 01:41:36 -0500 )edit

I used opencv-3.2.0 and opencv_contrib-3.2.0. I also meet this error -- Module opencv_sfm disabled because the following dependencies are not found: Eigen CMake Error at CMakeLists.txt:35 (ocv_module_disable): Unknown CMake command "ocv_module_disable".

However, I already install Eigen 3.2.92

double gravatar imagedouble ( 2017-06-13 14:55:55 -0500 )edit

I think there is a problem in cmakelist of sfm module. When you run cmake try to set -DEIGEN_INCLUDE_PATH=/usr/include/eigen3

LBerger gravatar imageLBerger ( 2017-06-13 15:01:04 -0500 )edit

i already added set(EIGEN_INCLUDE_PATH ${EIGEN_INCLUDE_PATH} $/usr/include/eigen3) in line 26. But it still give me this error. I have checked /usr/include/eigen3, eigen3 exists.

double gravatar imagedouble ( 2017-06-13 15:26:34 -0500 )edit

so try -DEIGEN_INCLUDE_PATH=/usr/include/eigen3 -DEIGEN_INCLUDE_DIR=/usr/include/eigen3

LBerger gravatar imageLBerger ( 2017-06-13 15:34:11 -0500 )edit

I tried cmake -DEIGEN_INCLUDE_PATH=/usr/include/eigen3 -DEIGEN_INCLUDE_DIR=/usr/include/eigen3 .. and cmake -DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.2.0/modules -DEIGEN_INCLUDE_PATH=/usr/include/eigen3/ .. Both of them give me the same error :(

double gravatar imagedouble ( 2017-06-13 17:05:32 -0500 )edit

delete cmake_cache.txt

LBerger gravatar imageLBerger ( 2017-06-14 00:47:41 -0500 )edit