Last active
May 25, 2025 13:29
-
-
Save cdcseacave/ef290eacefa44db67dadaed01a6fe319 to your computer and use it in GitHub Desktop.
Build latest OpenMVG+OpenMVS+COLMAP in docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 | |
# Get dependencies | |
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
cmake \ | |
build-essential \ | |
graphviz \ | |
git \ | |
coinor-libclp-dev \ | |
libceres-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libtiff-dev \ | |
libxi-dev \ | |
libxinerama-dev \ | |
libxcursor-dev \ | |
libxxf86vm-dev; \ | |
apt-get autoclean && apt-get clean | |
# Eigen (Known issues with eigen 3.3.7 as of 12/10/2019, so using this tested branch/commit instead) | |
RUN git clone https://gitlab.com/libeigen/eigen --branch 3.2; \ | |
mkdir eigen_build && cd eigen_build; \ | |
cmake -DCMAKE_BUILD_TYPE=RELEASE . ../eigen; \ | |
make && make install; \ | |
cd .. && rm -rf eigen_build | |
# Boost | |
RUN apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev | |
# OpenCV | |
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq libopencv-dev | |
#GLFW3 (Optional) | |
RUN apt-get -y install freeglut3-dev libglew-dev libglfw3-dev | |
# Build latest openvMVG | |
RUN git clone --recursive https://github.com/openMVG/openMVG.git --branch develop; \ | |
mkdir openMVG_build && cd openMVG_build; \ | |
cmake -DCMAKE_BUILD_TYPE=RELEASE \ | |
-DCMAKE_INSTALL_PREFIX="/opt" \ | |
-DOpenMVG_BUILD_TESTS=OFF \ | |
-DOpenMVG_BUILD_EXAMPLES=OFF \ | |
-DOpenMVG_BUILD_DOC=OFF \ | |
-DOpenMVG_BUILD_OPENGL_EXAMPLES=ON \ | |
-DOpenMVG_USE_OPENCV=ON \ | |
-DOpenMVG_USE_OCVSIFT=OFF \ | |
-DCOINUTILS_INCLUDE_DIR_HINTS=/usr/include \ | |
-DCLP_INCLUDE_DIR_HINTS=/usr/include \ | |
-DOSI_INCLUDE_DIR_HINTS=/usr/include \ | |
-DEIGEN_INCLUDE_DIR=/usr/local/include/eigen3 \ | |
-DEIGEN_INCLUDE_DIR_HINTS=/usr/local/include/eigen3 \ | |
../openMVG/src; \ | |
make -j 4 && make install; \ | |
cp ../openMVG/src/openMVG/exif/sensor_width_database/sensor_width_camera_database.txt /opt/bin/; \ | |
cd .. && rm -rf openMVG_build | |
# CGAL | |
RUN apt-get -y install libcgal-dev libcgal-qt5-dev | |
# VCGLib | |
RUN git clone https://github.com/cdcseacave/VCG.git vcglib | |
# Build latest openMVS | |
RUN git clone https://github.com/cdcseacave/openMVS.git --branch develop; \ | |
mkdir openMVS_build && cd openMVS_build; \ | |
cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release \ | |
-DVCG_ROOT=/vcglib \ | |
-DEIGEN_INCLUDE_DIR=/usr/local/include/eigen3 \ | |
-DCMAKE_INSTALL_PREFIX="/opt"; \ | |
make -j4 && make install; \ | |
cp ../openMVS/MvgMvsPipeline.py /opt/bin/; \ | |
cd .. && rm -rf openMVS_build | |
# Add binaries to path | |
ENV PATH $PATH:/opt/bin:/opt/bin/OpenMVS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had to make a few modifications to get it to work with Ubuntu 22.04