Add hybrid bundling option to OpenSfM step

Former-commit-id: b8b8acf5f1
pull/1161/head
Dakota Benjamin 2017-12-07 14:41:37 -05:00
rodzic afe8ca183a
commit ff23e21147
6 zmienionych plików z 27 dodań i 7 usunięć

Wyświetl plik

@ -8,8 +8,8 @@ ExternalProject_Add(${_proj_name}
STAMP_DIR ${_SB_BINARY_DIR}/stamp
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
URL https://github.com/OpenDroneMap/mvs-texturing/archive/bc2c5695e32366fc00e04a560d0d933715a524a1.zip
URL_MD5 1c53b1bd78695fe55b7df118c4216605
URL https://github.com/OpenDroneMap/mvs-texturing/archive/4f885aff1d92fb20a7d72d320be5b935397c81c9.zip
URL_MD5 cbcccceba4693c6c882eb4aa618a2227
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------

Wyświetl plik

@ -16,6 +16,7 @@ project_path: '/' #DO NOT CHANGE THIS OR DOCKER WILL NOT WORK. It should be '/'
#verbose: False
#time: False
#use_fixed_camera_params: False
#use_hybrid_bundle_adjustment: False
#opensfm_processes: 4 # by default this is set to $(nproc)
#min_num_features: 4000
#matcher_threshold: 2.0
@ -43,6 +44,7 @@ project_path: '/' #DO NOT CHANGE THIS OR DOCKER WILL NOT WORK. It should be '/'
#texturing_keep_unseen_faces: False
#texturing_tone_mapping: 'none'
#gcp: !!null # YAML tag for None
#use_exif: False # Set to True if you have a GCP file (it auto-detects) and want to use EXIF
#dtm: False # Use this tag to build a DTM (Digital Terrain Model
#dsm: False # Use this tag to build a DSM (Digital Surface Model
#dem-gapfill-steps: 4
@ -52,8 +54,9 @@ project_path: '/' #DO NOT CHANGE THIS OR DOCKER WILL NOT WORK. It should be '/'
#dem-approximate: False
#dem-decimation: 1
#dem-terrain-type: ComplexForest
#use_exif: False # Set to True if you have a GCP file (it auto-detects) and want to use EXIF
#orthophoto_resolution: 20.0 # Pixels/meter
#orthophoto_target_srs: !!null # Currently does nothing
#orthophoto_no_tiled: False
#orthophoto_compression: DEFLATE # Options are [JPEG, LZW, PACKBITS, DEFLATE, LZMA, NONE] Don't change unless you know what you are doing
#orthophoto_bigtiff: IF_SAFER # Options are [YES, NO, IF_NEEDED, IF_SAFER]
#build_overviews: FALSE

Wyświetl plik

@ -2,7 +2,6 @@ import argparse
from opendm import context
from opendm import io
from opendm import log
from yaml import safe_load
from appsettings import SettingsParser
import sys
@ -143,7 +142,13 @@ def config():
type=int,
help=('The maximum number of processes to use in dense '
'reconstruction. Default: %(default)s'))
parser.add_argument('--use-hybrid-bundle-adjustment',
action='store_true',
default=False,
help='Run local bundle adjustment for every image added to the reconstruction and a global '
'adjustment every 100 images. Speeds up reconstruction for very large datasets.')
parser.add_argument('--use-25dmesh',
action='store_true',
default=False,

Wyświetl plik

@ -45,7 +45,8 @@ class ODMApp(ecto.BlackBox):
processes=p.args.opensfm_processes,
matching_gps_neighbors=p.args.matcher_neighbors,
matching_gps_distance=p.args.matcher_distance,
fixed_camera_params=p.args.use_fixed_camera_params),
fixed_camera_params=p.args.use_fixed_camera_params,
hybrid_bundle_adjustment=p.args.use_hybrid_bundle_adjustment),
'slam': ODMSlamCell(),
'cmvs': ODMCmvsCell(max_images=p.args.cmvs_maxImages),
'pmvs': ODMPmvsCell(level=p.args.pmvs_level,
@ -97,7 +98,7 @@ class ODMApp(ecto.BlackBox):
def connections(self, p):
if p.args.video:
return self.slam_connections(_p)
return self.slam_connections(p)
# define initial task
# TODO: What is this?

Wyświetl plik

@ -15,6 +15,7 @@ class ODMOpenSfMCell(ecto.Cell):
params.declare("matching_gps_neighbors", "The application arguments.", 8)
params.declare("matching_gps_distance", "The application arguments.", 0)
params.declare("fixed_camera_params", "Optimize internal camera parameters", True)
params.declare("hybrid_bundle_adjustment", "USe local + global bundle adjustment", False)
def declare_io(self, params, inputs, outputs):
inputs.declare("tree", "Struct with paths", [])
@ -80,6 +81,12 @@ class ODMOpenSfMCell(ecto.Cell):
config.append("use_altitude_tag: True")
config.append("align_method: naive")
if args.use_hybrid_bundle_adjustment:
log.ODM_DEBUG("Enabling hybrid bundle adjustment")
config.append("bundle_interval: 100") # Bundle after adding 'bundle_interval' cameras
config.append("bundle_new_points_ratio: 1.2") # Bundle when (new points) / (bundled points) > bundle_new_points_ratio
config.append("local_bundle_radius: 1") # Max image graph distance for images to be included in local bundle adjustment
if args.matcher_distance > 0:
config.append("matching_gps_distance: %s" % self.params.matching_gps_distance)

Wyświetl plik

@ -16,6 +16,7 @@ project_path: '' # Example: '/home/user/ODMProjects
#verbose: False
#time: False
#use_fixed_camera_params: False
#use_hybrid_bundle_adjustment: False
#opensfm_processes: 4 # by default this is set to $(nproc)
#min_num_features: 4000
#matcher_threshold: 2.0
@ -57,3 +58,6 @@ project_path: '' # Example: '/home/user/ODMProjects
#orthophoto_target_srs: !!null # Currently does nothing
#orthophoto_no_tiled: False
#orthophoto_compression: DEFLATE # Options are [JPEG, LZW, PACKBITS, DEFLATE, LZMA, NONE] Don't change unless you know what you are doing
#orthophoto_bigtiff: IF_SAFER # Options are [YES, NO, IF_NEEDED, IF_SAFER]
#build_overviews: FALSE