Deploy Cv environment for ubuntu, colmap, openmvs, e.g.

1 minute read

Environment

  • Ubuntu 18.04.5 LTS
  • x86_64
  • gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

Colmap

Require

sudo apt-get install \
    git \
    cmake \
    build-essential \
    libboost-program-options-dev \
    libboost-filesystem-dev \
    libboost-graph-dev \
    libboost-system-dev \
    libboost-test-dev \
    libeigen3-dev \
    libsuitesparse-dev \
    libfreeimage-dev \
    libgoogle-glog-dev \
    libgflags-dev \
    libglew-dev \
    qtbase5-dev \
    libqt5opengl5-dev \
    libcgal-dev

Install Qt5

  • Attation
    • If you have install conda or anconda
    • Remeber conda deactivate untile you dont in any conda environment
    • And remeber rename anaconda3 to anaconda3temp for temporary, and rename it back after install.
sudo apt-get install libcgal-qt5-dev

Install ceres-solver

sudo apt-get install libatlas-base-dev libsuitesparse-dev
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
git checkout $(git describe --tags) # Checkout the latest release
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j
sudo make install

Install COLMAP

git clone https://github.com/colmap/colmap.git
cd colmap
git checkout dev
mkdir build
cd build
cmake ..
make -j
sudo make install

Usage

colmap -h
colmap gui

OpenMVS

compiler

  • Prepare
sudo apt update -qq && sudo apt install -qq
sudo apt -y install git cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev
  • Install Eigen (Required)
git clone https://gitlab.com/libeigen/eigen.git --branch 3.2
cd eigen && mkdir eigen_build && cd eigen_build
cmake . ..
make && sudo make install
  • Install Boost (Required)
sudo apt -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev
  • Install OpenCV (Required)
    • Attation, It will lead to a undefined reference to symbol when make for openmvs
    • Look at this issue
    • And for another conflict, make your opencv version is correct, for me, it is 3.2, check it with dpkg -s libopencv-dev
sudo apt -y install libopencv-dev
  • Install CGAL (Required)
    • Attation, please ensure you are not under anaconda environment, and rename the anaconda dir name temporary
    • conda will install qt into itself directory, may lead to can not find qt or find a wrong qt problem
sudo apt -y install libcgal-dev libcgal-qt5-dev
git clone https://github.com/cdcseacave/VCG.git vcglib
  • Install Ceres (optional)
sudo apt -y install libatlas-base-dev libsuitesparse-dev
git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver
cd ceres-solver && mkdir ceres_build && cd ceres_build
cmake . .. -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j8 && sudo make install
cd ..
  • Install GLFW3 (Optional)
sudo apt -y install freeglut3-dev libglew-dev libglfw3-dev
git clone https://github.com/cdcseacave/openMVS.git openMVS
cd openMVS && mkdir openMVS_build && cd openMVS_build
cmake . .. -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT="path/to/VGC" -DBUILD_SHARED_LIBS=ON
make -j8 && sudo make install

Reading

Categories:

Updated: