2015-11-18 16:36:59 +00:00
|
|
|
import argparse
|
2017-02-09 17:55:45 +00:00
|
|
|
from opendm import context
|
2017-03-23 18:55:22 +00:00
|
|
|
from opendm import io
|
2017-03-27 19:41:51 +00:00
|
|
|
from opendm import log
|
|
|
|
from yaml import safe_load
|
|
|
|
from appsettings import SettingsParser
|
|
|
|
|
|
|
|
import sys
|
2015-11-18 16:36:59 +00:00
|
|
|
|
|
|
|
# parse arguments
|
2016-02-04 13:35:15 +00:00
|
|
|
processopts = ['resize', 'opensfm', 'slam', 'cmvs', 'pmvs',
|
2017-04-05 17:56:48 +00:00
|
|
|
'odm_meshing', 'odm_25dmeshing', 'mvs_texturing', 'odm_georeferencing',
|
2015-11-18 16:36:59 +00:00
|
|
|
'odm_orthophoto']
|
|
|
|
|
2017-03-23 18:55:22 +00:00
|
|
|
with open(io.join_paths(context.root_path, 'VERSION')) as version_file:
|
|
|
|
__version__ = version_file.read().strip()
|
2017-03-07 19:58:40 +00:00
|
|
|
|
2017-03-27 19:41:51 +00:00
|
|
|
|
2017-02-09 23:57:24 +00:00
|
|
|
def alphanumeric_string(string):
|
|
|
|
import re
|
2017-03-08 20:19:00 +00:00
|
|
|
if re.match('^[a-zA-Z0-9_-]+$', string) is None:
|
2017-02-09 23:57:24 +00:00
|
|
|
msg = '{0} is not a valid name. Must use alphanumeric characters.'.format(string)
|
|
|
|
raise argparse.ArgumentTypeError(msg)
|
|
|
|
return string
|
2016-02-26 18:50:12 +00:00
|
|
|
|
2017-03-07 19:58:40 +00:00
|
|
|
|
2016-02-25 18:39:38 +00:00
|
|
|
class RerunFrom(argparse.Action):
|
2016-02-25 19:05:45 +00:00
|
|
|
def __call__(self, parser, namespace, values, option_string=None):
|
2016-02-25 18:39:38 +00:00
|
|
|
setattr(namespace, self.dest, processopts[processopts.index(values):])
|
|
|
|
|
|
|
|
|
2017-03-27 19:41:51 +00:00
|
|
|
parser = SettingsParser(description='OpenDroneMap',
|
|
|
|
usage='%(prog)s [options] <project name>',
|
|
|
|
yaml_file=open(context.settings_path))
|
2016-03-08 18:26:58 +00:00
|
|
|
|
|
|
|
def config():
|
2016-12-09 14:51:25 +00:00
|
|
|
parser.add_argument('--images', '-i',
|
2017-03-07 19:58:40 +00:00
|
|
|
metavar='<path>',
|
2016-12-09 14:51:25 +00:00
|
|
|
help='Path to input images'),
|
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
parser.add_argument('--project-path',
|
2017-03-07 19:58:40 +00:00
|
|
|
metavar='<path>',
|
2017-03-27 19:41:51 +00:00
|
|
|
help='Path to the project folder')
|
2016-03-08 18:26:58 +00:00
|
|
|
|
2017-02-09 23:57:24 +00:00
|
|
|
parser.add_argument('name',
|
2017-03-07 19:58:40 +00:00
|
|
|
metavar='<project name>',
|
2017-02-09 23:57:24 +00:00
|
|
|
type=alphanumeric_string,
|
|
|
|
help='Name of Project (i.e subdirectory of projects folder)')
|
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
parser.add_argument('--resize-to', # currently doesn't support 'orig'
|
|
|
|
metavar='<integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=2400,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help='resizes images by the largest side')
|
2017-05-11 19:37:05 +00:00
|
|
|
|
|
|
|
parser.add_argument('--skip-resize',
|
|
|
|
action='store_true',
|
|
|
|
default=False,
|
|
|
|
help='Skips resizing of images')
|
2016-03-08 18:26:58 +00:00
|
|
|
|
|
|
|
parser.add_argument('--start-with', '-s',
|
|
|
|
metavar='<string>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default='resize',
|
2016-03-08 18:26:58 +00:00
|
|
|
choices=processopts,
|
|
|
|
help=('Can be one of: ' + ' | '.join(processopts)))
|
|
|
|
|
|
|
|
parser.add_argument('--end-with', '-e',
|
|
|
|
metavar='<string>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default='odm_orthophoto',
|
2016-03-08 18:26:58 +00:00
|
|
|
choices=processopts,
|
|
|
|
help=('Can be one of:' + ' | '.join(processopts)))
|
|
|
|
|
|
|
|
rerun = parser.add_mutually_exclusive_group()
|
|
|
|
|
|
|
|
rerun.add_argument('--rerun', '-r',
|
|
|
|
metavar='<string>',
|
|
|
|
choices=processopts,
|
|
|
|
help=('Can be one of:' + ' | '.join(processopts)))
|
|
|
|
|
|
|
|
rerun.add_argument('--rerun-all',
|
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-03-08 18:26:58 +00:00
|
|
|
help='force rerun of all tasks')
|
|
|
|
|
|
|
|
rerun.add_argument('--rerun-from',
|
|
|
|
action=RerunFrom,
|
|
|
|
metavar='<string>',
|
|
|
|
choices=processopts,
|
|
|
|
help=('Can be one of:' + ' | '.join(processopts)))
|
|
|
|
|
2016-05-18 11:09:36 +00:00
|
|
|
parser.add_argument('--video',
|
|
|
|
metavar='<string>',
|
|
|
|
help='Path to the video file to process')
|
|
|
|
|
|
|
|
parser.add_argument('--slam-config',
|
|
|
|
metavar='<string>',
|
|
|
|
help='Path to config file for orb-slam')
|
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
parser.add_argument('--force-focal',
|
|
|
|
metavar='<positive float>',
|
|
|
|
type=float,
|
|
|
|
help=('Override the focal length information for the '
|
|
|
|
'images'))
|
|
|
|
|
|
|
|
parser.add_argument('--force-ccd',
|
|
|
|
metavar='<positive float>',
|
|
|
|
type=float,
|
|
|
|
help='Override the ccd width information for the images')
|
|
|
|
|
|
|
|
parser.add_argument('--min-num-features',
|
|
|
|
metavar='<integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=4000,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help=('Minimum number of features to extract per image. '
|
|
|
|
'More features leads to better results but slower '
|
|
|
|
'execution. Default: %(default)s'))
|
|
|
|
|
|
|
|
parser.add_argument('--matcher-threshold',
|
|
|
|
metavar='<percent>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=2.0,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=float,
|
|
|
|
help=('Ignore matched keypoints if the two images share '
|
|
|
|
'less than <float> percent of keypoints. Default:'
|
2016-07-08 16:55:22 +00:00
|
|
|
' %(default)s'))
|
2016-03-08 18:26:58 +00:00
|
|
|
|
|
|
|
parser.add_argument('--matcher-ratio',
|
|
|
|
metavar='<float>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=0.6,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=float,
|
|
|
|
help=('Ratio of the distance to the next best matched '
|
|
|
|
'keypoint. Default: %(default)s'))
|
|
|
|
|
|
|
|
parser.add_argument('--matcher-neighbors',
|
|
|
|
type=int,
|
|
|
|
metavar='<integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=8,
|
2016-03-08 18:26:58 +00:00
|
|
|
help='Number of nearest images to pre-match based on GPS '
|
|
|
|
'exif data. Set to 0 to skip pre-matching. '
|
|
|
|
'Neighbors works together with Distance parameter, '
|
|
|
|
'set both to 0 to not use pre-matching. OpenSFM '
|
|
|
|
'uses both parameters at the same time, Bundler '
|
|
|
|
'uses only one which has value, prefering the '
|
|
|
|
'Neighbors parameter. Default: %(default)s')
|
|
|
|
|
|
|
|
parser.add_argument('--matcher-distance',
|
|
|
|
metavar='<integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=0,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help='Distance threshold in meters to find pre-matching '
|
2017-03-27 19:41:51 +00:00
|
|
|
'images based on GPS exif data. Set both '
|
|
|
|
'matcher-neighbors and this to 0 to skip '
|
2016-03-08 18:26:58 +00:00
|
|
|
'pre-matching. Default: %(default)s')
|
|
|
|
|
2017-01-12 17:03:14 +00:00
|
|
|
parser.add_argument('--opensfm-processes',
|
|
|
|
metavar='<positive integer>',
|
2017-05-16 00:46:21 +00:00
|
|
|
default=1,
|
2017-01-12 17:03:14 +00:00
|
|
|
type=int,
|
|
|
|
help=('The maximum number of processes to use in dense '
|
|
|
|
'reconstruction. Default: %(default)s'))
|
2017-04-05 17:56:48 +00:00
|
|
|
|
2017-04-25 15:17:20 +00:00
|
|
|
parser.add_argument('--use-25dmesh',
|
2017-04-05 17:56:48 +00:00
|
|
|
action='store_true',
|
|
|
|
default=False,
|
2017-04-25 15:17:20 +00:00
|
|
|
help='Use a 2.5D mesh to compute the orthophoto. This option tends to provide better results for planar surfaces. Experimental.')
|
2017-04-05 17:56:48 +00:00
|
|
|
|
2016-12-27 18:44:48 +00:00
|
|
|
parser.add_argument('--use-pmvs',
|
2016-09-30 13:08:56 +00:00
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2017-03-08 20:19:00 +00:00
|
|
|
help='Use pmvs to compute point cloud alternatively')
|
2016-09-30 13:08:56 +00:00
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
parser.add_argument('--cmvs-maxImages',
|
|
|
|
metavar='<integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=500,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help='The maximum number of images per cluster. '
|
|
|
|
'Default: %(default)s')
|
|
|
|
|
|
|
|
parser.add_argument('--pmvs-level',
|
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=1,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help=('The level in the image pyramid that is used '
|
|
|
|
'for the computation. see '
|
|
|
|
'http://www.di.ens.fr/pmvs/documentation.html for '
|
|
|
|
'more pmvs documentation. Default: %(default)s'))
|
|
|
|
|
|
|
|
parser.add_argument('--pmvs-csize',
|
2017-03-10 16:43:26 +00:00
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=2,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help='Cell size controls the density of reconstructions'
|
|
|
|
'Default: %(default)s')
|
|
|
|
|
|
|
|
parser.add_argument('--pmvs-threshold',
|
|
|
|
metavar='<float: -1.0 <= x <= 1.0>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=0.7,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=float,
|
|
|
|
help=('A patch reconstruction is accepted as a success '
|
|
|
|
'and kept if its associated photometric consistency '
|
|
|
|
'measure is above this threshold. Default: %(default)s'))
|
|
|
|
|
|
|
|
parser.add_argument('--pmvs-wsize',
|
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=7,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help='pmvs samples wsize x wsize pixel colors from '
|
|
|
|
'each image to compute photometric consistency '
|
|
|
|
'score. For example, when wsize=7, 7x7=49 pixel '
|
|
|
|
'colors are sampled in each image. Increasing the '
|
|
|
|
'value leads to more stable reconstructions, but '
|
|
|
|
'the program becomes slower. Default: %(default)s')
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--pmvs-min-images',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=3,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help=('Each 3D point must be visible in at least '
|
|
|
|
'minImageNum images for being reconstructed. 3 is '
|
|
|
|
'suggested in general. Default: %(default)s'))
|
|
|
|
|
|
|
|
parser.add_argument('--pmvs-num-cores',
|
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=context.num_cores,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help=('The maximum number of cores to use in dense '
|
|
|
|
'reconstruction. Default: %(default)s'))
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--mesh-size',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=100000,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help=('The maximum vertex count of the output mesh '
|
|
|
|
'Default: %(default)s'))
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--mesh-octree-depth',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=9,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help=('Oct-tree depth used in the mesh reconstruction, '
|
|
|
|
'increase to get more vertices, recommended '
|
|
|
|
'values are 8-12. Default: %(default)s'))
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--mesh-samples',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<float >= 1.0>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=1.0,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=float,
|
|
|
|
help=('Number of points per octree node, recommended '
|
|
|
|
'and default value: %(default)s'))
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--mesh-solver-divide',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<positive integer>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=9,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=int,
|
|
|
|
help=('Oct-tree depth at which the Laplacian equation '
|
|
|
|
'is solved in the surface reconstruction step. '
|
|
|
|
'Increasing this value increases computation '
|
|
|
|
'times slightly but helps reduce memory usage. '
|
|
|
|
'Default: %(default)s'))
|
2017-04-18 21:18:09 +00:00
|
|
|
|
|
|
|
parser.add_argument('--mesh-remove-outliers',
|
|
|
|
metavar='<percent>',
|
|
|
|
default=2,
|
|
|
|
type=float,
|
|
|
|
help=('Percentage of outliers to remove from the point set. Set to 0 to disable. '
|
|
|
|
'Applies to 2.5D mesh only. '
|
|
|
|
'Default: %(default)s'))
|
2016-03-08 18:26:58 +00:00
|
|
|
|
2017-04-06 21:33:36 +00:00
|
|
|
parser.add_argument('--mesh-wlop-iterations',
|
|
|
|
metavar='<positive integer>',
|
2017-04-18 14:48:17 +00:00
|
|
|
default=35,
|
2017-04-06 21:33:36 +00:00
|
|
|
type=int,
|
|
|
|
help=('Iterations of the Weighted Locally Optimal Projection (WLOP) simplification algorithm. '
|
|
|
|
'Higher values take longer but produce a smoother mesh. '
|
|
|
|
'Applies to 2.5D mesh only. '
|
|
|
|
'Default: %(default)s'))
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--texturing-data-term',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<string>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default='gmi',
|
|
|
|
choices=['gmi', 'area'],
|
2016-12-14 18:30:44 +00:00
|
|
|
help=('Data term: [area, gmi]. Default: '
|
|
|
|
'%(default)s'))
|
2016-03-08 18:26:58 +00:00
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--texturing-outlier-removal-type',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<string>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default='gauss_clamping',
|
|
|
|
choices=['none', 'gauss_clamping', 'gauss_damping'],
|
2016-03-08 18:26:58 +00:00
|
|
|
help=('Type of photometric outlier removal method: '
|
|
|
|
'[none, gauss_damping, gauss_clamping]. Default: '
|
|
|
|
'%(default)s'))
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--texturing-skip-visibility-test',
|
2016-09-24 15:14:01 +00:00
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-12-14 18:30:44 +00:00
|
|
|
help=('Skip geometric visibility test. Default: '
|
|
|
|
' %(default)s'))
|
2016-03-08 18:26:58 +00:00
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--texturing-skip-global-seam-leveling',
|
2016-09-24 15:14:01 +00:00
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-12-14 18:30:44 +00:00
|
|
|
help=('Skip global seam leveling. Useful for IR data.'
|
|
|
|
'Default: %(default)s'))
|
2016-03-08 18:26:58 +00:00
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--texturing-skip-local-seam-leveling',
|
2016-09-24 15:14:01 +00:00
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-12-14 18:30:44 +00:00
|
|
|
help='Skip local seam blending. Default: %(default)s')
|
2016-03-08 18:26:58 +00:00
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--texturing-skip-hole-filling',
|
2016-09-24 15:14:01 +00:00
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-12-14 18:30:44 +00:00
|
|
|
help=('Skip filling of holes in the mesh. Default: '
|
|
|
|
' %(default)s'))
|
2016-03-08 18:26:58 +00:00
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--texturing-keep-unseen-faces',
|
2016-09-24 15:14:01 +00:00
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-03-08 18:26:58 +00:00
|
|
|
help=('Keep faces in the mesh that are not seen in any camera. '
|
|
|
|
'Default: %(default)s'))
|
|
|
|
|
2017-02-22 17:41:24 +00:00
|
|
|
parser.add_argument('--texturing-tone-mapping',
|
|
|
|
metavar='<string>',
|
|
|
|
choices=['none', 'gamma'],
|
2017-03-27 19:41:51 +00:00
|
|
|
default='none',
|
2017-02-22 17:41:24 +00:00
|
|
|
help='Turn on gamma tone mapping or none for no tone '
|
|
|
|
'mapping. Choices are \'gamma\' or \'none\'. '
|
|
|
|
'Default: %(default)s ')
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--gcp',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<path string>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=None,
|
2016-03-08 18:26:58 +00:00
|
|
|
help=('path to the file containing the ground control '
|
|
|
|
'points used for georeferencing. Default: '
|
|
|
|
'%(default)s. The file needs to '
|
|
|
|
'be on the following line format: \neasting '
|
|
|
|
'northing height pixelrow pixelcol imagename'))
|
|
|
|
|
2016-12-21 20:56:27 +00:00
|
|
|
parser.add_argument('--use-exif',
|
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-12-21 20:56:27 +00:00
|
|
|
help=('Use this tag if you have a gcp_list.txt but '
|
|
|
|
'want to use the exif geotags instead'))
|
|
|
|
|
2017-04-06 13:06:09 +00:00
|
|
|
parser.add_argument('--dem',
|
|
|
|
action='store_true',
|
|
|
|
default=False,
|
|
|
|
help='Use this tag to build a DEM using a progressive '
|
|
|
|
'morphological filter in PDAL.')
|
|
|
|
|
2017-04-06 19:37:13 +00:00
|
|
|
parser.add_argument('--dem-sample-radius',
|
|
|
|
metavar='<float>',
|
|
|
|
default=1.0,
|
|
|
|
type=float,
|
|
|
|
help='Minimum distance between samples for DEM '
|
|
|
|
'generation.\nDefault=%(default)s')
|
|
|
|
|
|
|
|
parser.add_argument('--dem-resolution',
|
|
|
|
metavar='<float>',
|
|
|
|
type=float,
|
|
|
|
default=2,
|
|
|
|
help='Length of raster cell edges in X/Y units.'
|
|
|
|
'\nDefault: %(default)s')
|
|
|
|
|
|
|
|
parser.add_argument('--dem-radius',
|
|
|
|
metavar='<float>',
|
|
|
|
type=float,
|
|
|
|
default=0.5,
|
|
|
|
help='Radius about cell center bounding points to '
|
|
|
|
'use to calculate a cell value.\nDefault: '
|
|
|
|
'%(default)s')
|
|
|
|
|
2016-12-14 18:30:44 +00:00
|
|
|
parser.add_argument('--orthophoto-resolution',
|
2016-03-08 18:26:58 +00:00
|
|
|
metavar='<float > 0.0>',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=20.0,
|
2016-03-08 18:26:58 +00:00
|
|
|
type=float,
|
|
|
|
help=('Orthophoto ground resolution in pixels/meter'
|
|
|
|
'Default: %(default)s'))
|
|
|
|
|
2017-03-10 21:09:55 +00:00
|
|
|
parser.add_argument('--orthophoto-target-srs',
|
|
|
|
metavar="<EPSG:XXXX>",
|
|
|
|
type=str,
|
|
|
|
default=None,
|
|
|
|
help='Target spatial reference for orthophoto creation. '
|
|
|
|
'Not implemented yet.\n'
|
|
|
|
'Default: %(default)s')
|
|
|
|
|
|
|
|
parser.add_argument('--orthophoto-no-tiled',
|
|
|
|
action='store_true',
|
|
|
|
default=False,
|
|
|
|
help='Set this parameter if you want a stripped geoTIFF.\n'
|
|
|
|
'Default: %(default)s')
|
|
|
|
|
|
|
|
parser.add_argument('--orthophoto-compression',
|
2017-03-27 19:41:51 +00:00
|
|
|
metavar='<string>',
|
2017-03-10 21:09:55 +00:00
|
|
|
type=str,
|
2017-03-27 19:41:51 +00:00
|
|
|
choices=['JPEG', 'LZW', 'PACKBITS', 'DEFLATE', 'LZMA', 'NONE'],
|
2017-03-10 21:09:55 +00:00
|
|
|
default='DEFLATE',
|
|
|
|
help='Set the compression to use. Note that this could '
|
|
|
|
'break gdal_translate if you don\'t know what you '
|
|
|
|
'are doing. Options: %(choices)s.\nDefault: %(default)s')
|
|
|
|
|
2017-03-29 20:13:34 +00:00
|
|
|
parser.add_argument('--orthophoto-bigtiff',
|
2017-03-31 14:52:46 +00:00
|
|
|
type=str,
|
|
|
|
choices=['YES', 'NO','IF_NEEDED','IF_SAFER'],
|
|
|
|
default='IF_SAFER',
|
|
|
|
help='Control whether the created orthophoto is a BigTIFF or '
|
|
|
|
'classic TIFF. BigTIFF is a variant for files larger than '
|
|
|
|
'4GiB of data. Options are %(choices)s. See GDAL specs: '
|
|
|
|
'https://www.gdal.org/frmt_gtiff.html for more info. '
|
|
|
|
'\nDefault: %(default)s')
|
2017-03-29 20:13:34 +00:00
|
|
|
|
2017-03-31 18:53:47 +00:00
|
|
|
parser.add_argument('--build-overviews',
|
|
|
|
action='store_true',
|
|
|
|
default=False,
|
|
|
|
help='Build orthophoto overviews using gdaladdo.')
|
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
parser.add_argument('--zip-results',
|
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-03-08 18:26:58 +00:00
|
|
|
help='compress the results using gunzip')
|
|
|
|
|
2016-12-20 19:34:51 +00:00
|
|
|
parser.add_argument('--verbose', '-v',
|
2016-12-11 22:16:11 +00:00
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-12-11 22:16:11 +00:00
|
|
|
help='Print additional messages to the console\n'
|
|
|
|
'Default: %(default)s')
|
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
parser.add_argument('--time',
|
|
|
|
action='store_true',
|
2017-03-27 19:41:51 +00:00
|
|
|
default=False,
|
2016-03-08 18:26:58 +00:00
|
|
|
help='Generates a benchmark file with runtime info\n'
|
|
|
|
'Default: %(default)s')
|
|
|
|
|
2017-03-10 19:36:16 +00:00
|
|
|
parser.add_argument('--version',
|
2017-03-23 18:55:22 +00:00
|
|
|
action='version',
|
|
|
|
version='OpenDroneMap {0}'.format(__version__),
|
2017-03-10 19:36:16 +00:00
|
|
|
help='Displays version number and exits. ')
|
2017-03-10 16:43:26 +00:00
|
|
|
|
2017-03-27 19:41:51 +00:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
# check that the project path setting has been set properly
|
|
|
|
if not args.project_path:
|
|
|
|
log.ODM_ERROR('You need to set the project path in the '
|
|
|
|
'settings.yaml file before you can run ODM, '
|
|
|
|
'or use `--project-path <path>`. Run `python '
|
|
|
|
'run.py --help` for more information. ')
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
return args
|