Skip to content

Commit 4dcd378

Browse files
committed
Fixes
1 parent 634bd77 commit 4dcd378

6 files changed

+145
-56
lines changed

Dockerfile

+10-24
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,15 @@
33

44
FROM ubuntu:16.04
55
MAINTAINER Speden Aave <[email protected]>
6+
ARG UID=1000
7+
ARG GID=1000
68
WORKDIR /tmp
7-
RUN apt -y update && \
8-
apt -y install unzip curl build-essential git libpng-dev libxxf86vm1 libxxf86vm-dev libxi-dev libxrandr-dev graphviz mercurial cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev libopencv-dev libcgal-dev libcgal-qt5-dev libatlas-base-dev libsuitesparse-dev && \
9-
mkdir /tmp/build && \
10-
git clone -b develop --recursive https://github.com/openMVG/openMVG.git /tmp/build/openmvg && \
11-
mkdir /tmp/build/openmvg_build && cd /tmp/build/openmvg_build && \
12-
cmake -DCMAKE_BUILD_TYPE=RELEASE . /tmp/build/openmvg/src -DCMAKE_INSTALL_PREFIX=/opt/openmvg && \
13-
make -j2 && make install && \
14-
main_path=/tmp/build && \
15-
hg clone https://bitbucket.org/eigen/eigen#3.2 /tmp/build/eigen && \
16-
mkdir /tmp/build/eigen_build && cd /tmp/build/eigen_build && \
17-
cmake . ../eigen && \
18-
make -j2 && make install && \
19-
git clone https://github.com/cdcseacave/VCG.git /tmp/build/vcglib && \
20-
git clone https://ceres-solver.googlesource.com/ceres-solver /tmp/build/ceres_solver && \
21-
mkdir /tmp/build/ceres_build && cd /tmp/build/ceres_build && \
22-
cmake . ../ceres_solver/ -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF && \
23-
make -j2 && make install && \
24-
git clone https://github.com/cdcseacave/openMVS.git /tmp/build/openmvs && \
25-
mkdir /tmp/build/openmvs_build && cd /tmp/build/openmvs_build && \
26-
cmake . ../openmvs -DCMAKE_BUILD_TYPE=Release -DVCG_DIR="/tmp/build/vcglib" -DCMAKE_INSTALL_PREFIX=/opt/openmvs && \
27-
make -j2 && make install && \
28-
git clone https://github.com/rennu/dpg.git /opt/pipeline
29-
WORKDIR /
9+
ADD install /tmp/install
10+
RUN /tmp/install
3011
RUN rm -rf /tmp/build
31-
ENTRYPOINT ["/usr/bin/python", "-u", "/opt/pipeline/pipeline.py"]
12+
RUN groupadd -g $GID ptools
13+
RUN useradd -r -u $UID -m -g ptools ptools
14+
WORKDIR /
15+
USER ptools
16+
ENTRYPOINT ["/usr/bin/python", "-u", "/opt/pipeline/pipeline.py"]
17+

install

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
echo ubuntu soft core unlimited >> /etc/security/limits.conf
2+
echo ubuntu hard core unlimited >> /etc/security/limits.conf
3+
cd /tmp
4+
5+
# Upgrade system
6+
apt-get -y update && apt-get upgrade -y
7+
8+
# Install dependencies
9+
apt-get install -y \
10+
build-essential \
11+
cmake \
12+
curl \
13+
dstat \
14+
exiftool \
15+
ffmpeg \
16+
gdb \
17+
git \
18+
graphviz \
19+
htop \
20+
joe \
21+
libatlas-base-dev \
22+
libboost-filesystem-dev \
23+
libboost-iostreams-dev \
24+
libboost-program-options-dev \
25+
libboost-regex-dev \
26+
libboost-serialization-dev \
27+
libboost-system-dev \
28+
libboost-test-dev \
29+
libcgal-dev \
30+
libcgal-qt5-dev \
31+
libeigen3-dev \
32+
libfreeimage-dev \
33+
libgflags-dev \
34+
libglew-dev \
35+
libglu1-mesa-dev \
36+
libgoogle-glog-dev \
37+
libjpeg-dev \
38+
libopencv-dev \
39+
libpng-dev \
40+
libqt5opengl5-dev \
41+
libsuitesparse-dev \
42+
libtiff-dev \
43+
libxi-dev \
44+
libxrandr-dev \
45+
libxxf86vm-dev \
46+
libxxf86vm1 \
47+
mediainfo \
48+
mercurial \
49+
qtbase5-dev \
50+
unzip \
51+
libatlas-base-dev \
52+
libsuitesparse-dev
53+
mkdir /tmp/build
54+
55+
# Install openmvg
56+
git clone -b develop --recursive https://github.com/openMVG/openMVG.git /tmp/build/openmvg
57+
cd /tmp/build/openmvg
58+
mkdir /tmp/build/openmvg_build && cd /tmp/build/openmvg_build
59+
cmake -DCMAKE_BUILD_TYPE=RELEASE . /tmp/build/openmvg/src -DCMAKE_INSTALL_PREFIX=/opt/openmvg
60+
make && make install
61+
62+
# Install eigen
63+
hg clone https://bitbucket.org/eigen/eigen#3.2 /tmp/build/eigen
64+
mkdir /tmp/build/eigen_build && cd /tmp/build/eigen_build
65+
cmake . ../eigen
66+
make && make install
67+
68+
# Get vcglib
69+
git clone https://github.com/cdcseacave/VCG.git /tmp/build/vcglib
70+
71+
# Install ceres solver
72+
git clone https://ceres-solver.googlesource.com/ceres-solver /tmp/build/ceres_solver
73+
cd /tmp/build/ceres_solver && git checkout $(git describe --tags)
74+
mkdir /tmp/build/ceres_build && cd /tmp/build/ceres_build
75+
cmake . ../ceres_solver/ -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
76+
make && make install
77+
78+
# Install openmvs
79+
git clone https://github.com/cdcseacave/openMVS.git /tmp/build/openmvs
80+
cd /tmp/build/openmvs
81+
mkdir /tmp/build/openmvs_build && cd /tmp/build/openmvs_build
82+
cmake . ../openmvs -DCMAKE_BUILD_TYPE=Release -DVCG_DIR="/tmp/build/vcglib" -DCMAKE_INSTALL_PREFIX=/opt/openmvs
83+
make && make install
84+
85+
# Install cmvs-pmvs
86+
git clone https://github.com/pmoulon/CMVS-PMVS /tmp/build/cmvs-pmvs
87+
mkdir /tmp/build/cmvs-pmvs_build && cd /tmp/build/cmvs-pmvs_build
88+
cmake ../cmvs-pmvs/program -DCMAKE_INSTALL_PREFIX=/opt/cmvs
89+
make && make install
90+
91+
# Install colmap
92+
# git clone -b master https://github.com/colmap/colmap /tmp/build/colmap
93+
# mkdir -p /tmp/build/colmap_build && cd /tmp/build/colmap_build
94+
# cmake . ../colmap -DCMAKE_INSTALL_PREFIX=/opt/colmap
95+
# make && make install

install_ubuntu

-32
This file was deleted.

pipeline.py

+3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ def main():
187187

188188
if getOpt.findKey("--rscales"):
189189
refineMeshOptions += ['--scales', getOpt.optValue]
190+
191+
if getOpts.findKey("--rlevel"):
192+
refineMeshOptions += ['----resolution-level', getOpt.optValue]
190193

191194
# Texture Mesh
192195
if getOpt.findKey("--output-obj"):

readme.md

+4
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,8 @@ The end result should look something like this ![Example 2](https://i.imgur.com/
205205
--rscales
206206
Number of RefineMesh iterations
207207
Default: 3
208+
--rlevel
209+
Times to scale down the images before mesh refinement
210+
Default: 0
211+
208212

scripts/colmap_sparse_reconstruct.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Usage:
2+
# 1. Make sure your images are in /your/projet/path/images folder
3+
# 2. cd /your/project/path && colmap_sparse_reconstruct.sh
4+
PROJECT_PATH=$(pwd)
5+
COLMAPBIN=/opt/colmap/bin/colmap
6+
# Replace with 1 if you you plan to use GPU
7+
USE_GPU=0
8+
9+
/opt/colmap/bin/colmap feature_extractor \
10+
--database_path ${PROJECT_PATH}/database.db \
11+
--image_path ${PROJECT_PATH}/images \
12+
--SiftExtraction.max_image_size 10000 \
13+
--SiftExtraction.max_num_features 32768 \
14+
--SiftExtraction.use_gpu ${USE_GPU}
15+
16+
/opt/colmap/bin/colmap exhaustive_matcher \
17+
--database_path ${PROJECT_PATH}/database.db \
18+
--SiftMatching.use_gpu ${USE_GPU}
19+
20+
mkdir ${PROJECT_PATH}/sparse
21+
22+
/opt/colmap/bin/colmap mapper \
23+
--database_path ${PROJECT_PATH}/database.db \
24+
--image_path ${PROJECT_PATH}/images \
25+
--export_path ${PROJECT_PATH}/sparse
26+
27+
mkdir ${PROJECT_PATH}/dense
28+
29+
/opt/colmap/bin/colmap model_converter \
30+
--input_path ${PROJECT_PATH}/sparse/0 \
31+
--output_path ./sparse.nvm \
32+
--output_type NVM
33+

0 commit comments

Comments
 (0)