-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_MVG.sh
executable file
·75 lines (62 loc) · 4.07 KB
/
run_MVG.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# run_MVG.sh - Script to run openMVG, run it from the top level of the model
# directory, after init_project.sh
# Copyright (C) 2017 John Davies
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
model_name=${PWD##*/}
log_file="${model_name}_MVG.log"
camera_DB_path=/home/john/projects/openMVG/src/openMVG/exif/sensor_width_database
openMVG_path=/home/john/projects/openMVG_Build/Linux-x86_64-RELEASE
# Default settings:
#Option for openMVG_main_ComputeFeatures
describerPreset=HIGH
# option for reconstruction file extension
recon_ext=bin
# Check for a config override file
if [ -f ${model_name}.cfg ]
then
source ${model_name}.cfg
fi
echo "Starting openMVG calculations" > $log_file
echo "=============================" >> $log_file
echo "Config settings" >> $log_file
echo "describerPreset: $describerPreset" >> $log_file
echo "recon_ext: $recon_ext" >> $log_file
echo "********************************************************************" >> $log_file
echo `date "+%H:%M:%S"` ": openMVG_main_SfMInit_ImageListing" >> $log_file
echo "${openMVG_path}/openMVG_main_SfMInit_ImageListing -i `pwd`/images -o SfM/matches -d ${camera_DB_path}/sensor_width_camera_database.txt" >> $log_file
${openMVG_path}/openMVG_main_SfMInit_ImageListing -i `pwd`/images -o SfM/matches -d ${camera_DB_path}/sensor_width_camera_database.txt
echo "********************************************************************" >> $log_file
echo `date "+%H:%M:%S"` ": openMVG_main_ComputeFeatures" >> $log_file
echo "${openMVG_path}/openMVG_main_ComputeFeatures -i SfM/matches/sfm_data.json -o SfM/matches --describerPreset ${describerPreset}" >> $log_file
${openMVG_path}/openMVG_main_ComputeFeatures -i SfM/matches/sfm_data.json -o SfM/matches --describerPreset ${describerPreset}
echo "********************************************************************" >> $log_file
echo `date "+%H:%M:%S"` ": openMVG_main_ComputeMatches" >> $log_file
echo "${openMVG_path}/openMVG_main_ComputeMatches -i SfM/matches/sfm_data.json -o SfM/matches -g e" >> $log_file
${openMVG_path}/openMVG_main_ComputeMatches -i SfM/matches/sfm_data.json -o SfM/matches -g e
echo "********************************************************************" >> $log_file
echo `date "+%H:%M:%S"` ": openMVG_main_GlobalSfM" >> $log_file
echo "${openMVG_path}/openMVG_main_GlobalSfM -i SfM/matches/sfm_data.json -m SfM/matches -o SfM/reconstruction/global" >> $log_file
${openMVG_path}/openMVG_main_GlobalSfM -i SfM/matches/sfm_data.json -m SfM/matches -o SfM/reconstruction/global
echo "********************************************************************" >> $log_file
echo `date "+%H:%M:%S"` ": openMVG_main_ComputeSfM_DataColor" >> $log_file
echo "${openMVG_path}/openMVG_main_ComputeSfM_DataColor -i SfM/reconstruction/global/sfm_data.${recon_ext} -o SfM/reconstruction/global/colorized.ply" >> $log_file
${openMVG_path}/openMVG_main_ComputeSfM_DataColor -i SfM/reconstruction/global/sfm_data.${recon_ext} -o SfM/reconstruction/global/colorized.ply
echo "********************************************************************" >> $log_file
echo `date "+%H:%M:%S"` ": openMVG_main_openMVG2MVE2" >> $log_file
echo "${openMVG_path}/openMVG_main_openMVG2MVE2 -i SfM/reconstruction/global/sfm_data.${recon_ext} -o SfM/reconstruction/dense" >> $log_file
${openMVG_path}/openMVG_main_openMVG2MVE2 -i SfM/reconstruction/global/sfm_data.${recon_ext} -o SfM/reconstruction/dense
echo "********************************************************************" >> $log_file
echo `date "+%H:%M:%S"` ": End" >> $log_file