diff --git a/SuperBuild/cmake/External-MvsTexturing.cmake b/SuperBuild/cmake/External-MvsTexturing.cmake index ac790a5b..d637f682 100644 --- a/SuperBuild/cmake/External-MvsTexturing.cmake +++ b/SuperBuild/cmake/External-MvsTexturing.cmake @@ -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------------- diff --git a/docker.settings.yaml b/docker.settings.yaml index ce55db73..2a2e4092 100644 --- a/docker.settings.yaml +++ b/docker.settings.yaml @@ -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 diff --git a/opendm/config.py b/opendm/config.py index 1e1d3c81..5e7e91a3 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -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, diff --git a/scripts/odm_app.py b/scripts/odm_app.py index 9aea0816..1bc5aa24 100644 --- a/scripts/odm_app.py +++ b/scripts/odm_app.py @@ -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? diff --git a/scripts/opensfm.py b/scripts/opensfm.py index 0c9ef0df..76aa28b3 100644 --- a/scripts/opensfm.py +++ b/scripts/opensfm.py @@ -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) diff --git a/settings.yaml b/settings.yaml index 9d85393c..6413e590 100644 --- a/settings.yaml +++ b/settings.yaml @@ -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 +