OpenCV  4.9.0-dev
Open Source Computer Vision
No Matches
SFM module installation


The Structure from Motion module depends on some open source libraries.

  • Eigen 3.2.2 or later. Required
  • GLog 0.3.1 or later. Required
  • GFlags. Required
  • Ceres Solver. Needed by the reconstruction API in order to solve part of the Bundle Adjustment plus the points Intersect. If Ceres Solver is not installed on your system, the reconstruction funcionality will be disabled. Recommended


Required Dependencies

In case you are on Ubuntu you can simply install the required dependencies by typing the following command:

sudo apt-get install libeigen3-dev libgflags-dev libgoogle-glog-dev

Ceres Solver

Start by installing all the dependencies:

# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
# - If you want to build Ceres as a *static* library (the default)
# you can use the SuiteSparse package in the main Ubuntu package
# repository:
sudo apt-get install libsuitesparse-dev
# - However, if you want to build Ceres as a *shared* library, you must
# add the following PPA:
sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update
sudo apt-get install libsuitesparse-dev

We are now ready to build, test, and install Ceres:

git clone
cd ceres-solver
mkdir build && cd build
cmake ..
make -j4
make test
sudo make install