Reputation: 123
I'm a beginner with opencv library. I've installed it on Ubuntu 17.04 and everything during the installation was perfect, no error at all. I've installed the Opencv-master, builded it, then I downloaded the opencv_contrib-master and added it to the build folder.
I'm trying to build the scene_reconstruction using SFM (structure for motion). I've installed all the dependencies with:
sudo apt-get install libeigen3-dev libgflags-dev libgoogle-glog-dev
Then I've installed the Ceres Solver:
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
mkdir build && cd build
cmake ..
make -j4
make test
sudo make install
Everything was ok, no error at all. I tried to write the example_sfm_scene_reconstruction.cpp following the official documentation from here (Tutorial Scene Reconstruction).
With cmake .
there weren't any errors but when I try to do make
I've this error:
screenshot
The english version is fatal error: opencv2/sfm.hpp: no such file or directory #include
Maybe the path is not correct or I don't know what to think.
Thanks!
Upvotes: 2
Views: 3020
Reputation: 36
You have to build the OpenCV Release together with the Contrib Release. To build OpenCV with the Contrib Repository you will have to add a parameter to cmake:
cd <opencv_build_directory>
cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>
make -j5
I recommend getting a stable opencv version (e.g. 3.3.1) as opposed to checking out the master branch. Make sure that contrib is the same version. If you are unsure at all, just follow the instructions here: https://github.com/opencv/opencv_contrib
Also, you will need the dependencies for the sfm module before compiling opencv.
Upvotes: 1