From fe37770c52b62efa1285fd8d81b801f7fed1d810 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 14 Dec 2021 12:51:09 -0500 Subject: [PATCH] Add version in output log, remove --matcher-distance --- VERSION | 2 +- opendm/config.py | 22 ++++++++++++---------- opendm/osfm.py | 3 ++- run.py | 9 ++++++++- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/VERSION b/VERSION index 743af5e1..24ba9a38 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6.8 +2.7.0 diff --git a/opendm/config.py b/opendm/config.py index 3e3500aa..11ef8189 100755 --- a/opendm/config.py +++ b/opendm/config.py @@ -166,16 +166,6 @@ def config(argv=None, parser=None): 'Neighbors works together with Distance parameter, ' 'set both to 0 to not use pre-matching. Default: %(default)s') - parser.add_argument('--matcher-distance', - metavar='', - action=StoreValue, - default=0, - type=int, - help='Distance threshold in meters to find pre-matching ' - 'images based on GPS exif data. Set both ' - 'matcher-neighbors and this to 0 to skip ' - 'pre-matching. Default: %(default)s') - parser.add_argument('--use-fixed-camera-params', action=StoreTrue, nargs=0, @@ -241,6 +231,15 @@ def config(argv=None, parser=None): 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. Default: %(default)s') + parser.add_argument('--sfm-algorithm', + metavar='', + action=StoreValue, + default='incremental', + choices=['incremental', 'triangulation'], + help=('Choose the structure from motion algorithm. If camera positions and angles are available, triangulation is significantly faster for aerial datasets. ' + 'Can be one of: %(choices)s. Default: ' + '%(default)s')) + parser.add_argument('--use-3dmesh', action=StoreTrue, nargs=0, @@ -771,6 +770,9 @@ def config(argv=None, parser=None): if args.fast_orthophoto: log.ODM_INFO('Fast orthophoto is turned on, automatically setting --skip-3dmodel') args.skip_3dmodel = True + if not 'sfm_algorithm_is_set' in args: + log.ODM_INFO('Fast orthophoto is turned on, automatically setting --sfm-algorithm to triangulation') + args.sfm_algorithm = 'triangulation' if args.pc_rectify and not args.pc_classify: log.ODM_INFO("Ground rectify is turned on, automatically turning on point cloud classification") diff --git a/opendm/osfm.py b/opendm/osfm.py index ba68973a..313eb5b9 100644 --- a/opendm/osfm.py +++ b/opendm/osfm.py @@ -192,8 +192,9 @@ class OSFMContext: "feature_min_frames: %s" % args.min_num_features, "processes: %s" % args.max_concurrency, "matching_gps_neighbors: %s" % args.matcher_neighbors, - "matching_gps_distance: %s" % args.matcher_distance, + "matching_graph_rounds: 50", "optimize_camera_parameters: %s" % ('no' if args.use_fixed_camera_params or args.cameras else 'yes'), + "reconstruction_algorithm: %s" % (args.sfm_algorithm), "undistorted_image_format: tif", "bundle_outlier_filtering_type: AUTO", "sift_peak_threshold: 0.066", diff --git a/run.py b/run.py index 4e67eec9..8b1b02d4 100755 --- a/run.py +++ b/run.py @@ -17,10 +17,17 @@ from opendm.loghelpers import args_to_dict from stages.odm_app import ODMApp +def odm_version(): + try: + with open("VERSION") as f: + return f.read().split("\n")[0].strip() + except: + return "?" + if __name__ == '__main__': args = config.config() - log.ODM_INFO('Initializing ODM - %s' % system.now()) + log.ODM_INFO('Initializing ODM %s - %s' % (odm_version(), system.now())) # Print args args_dict = args_to_dict(args)