kopia lustrzana https://github.com/OpenDroneMap/ODM
Removed several flags
rodzic
5ff55a5ff8
commit
13105722ad
|
@ -203,15 +203,6 @@ def config(argv=None, parser=None):
|
|||
'processes. Peak memory requirement is ~1GB per '
|
||||
'thread and 2 megapixel image resolution. Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--depthmap-resolution',
|
||||
metavar='<positive float>',
|
||||
action=StoreValue,
|
||||
type=float,
|
||||
default=640,
|
||||
help=('Controls the density of the point cloud by setting the resolution of the depthmap images. Higher values take longer to compute '
|
||||
'but produce denser point clouds. Overrides the value calculated by --pc-quality.'
|
||||
'Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--use-hybrid-bundle-adjustment',
|
||||
action=StoreTrue,
|
||||
nargs=0,
|
||||
|
@ -437,20 +428,6 @@ def config(argv=None, parser=None):
|
|||
help='Simple Morphological Filter window radius parameter (meters). '
|
||||
'Default: %(default)s')
|
||||
|
||||
parser.add_argument('--texturing-data-term',
|
||||
metavar='<string>',
|
||||
action=StoreValue,
|
||||
default='gmi',
|
||||
choices=['gmi', 'area'],
|
||||
help=('When texturing the 3D mesh, for each triangle, choose to prioritize images with sharp features (gmi) or those that cover the largest area (area). Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--texturing-outlier-removal-type',
|
||||
metavar='<string>',
|
||||
action=StoreValue,
|
||||
default='gauss_clamping',
|
||||
choices=['none', 'gauss_clamping', 'gauss_damping'],
|
||||
help=('Type of photometric outlier removal method. Can be one of: %(choices)s. Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--texturing-skip-global-seam-leveling',
|
||||
action=StoreTrue,
|
||||
nargs=0,
|
||||
|
@ -470,15 +447,6 @@ def config(argv=None, parser=None):
|
|||
help=('Keep faces in the mesh that are not seen in any camera. '
|
||||
'Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--texturing-tone-mapping',
|
||||
metavar='<string>',
|
||||
action=StoreValue,
|
||||
choices=['none', 'gamma'],
|
||||
default='none',
|
||||
help='Turn on gamma tone mapping or none for no tone '
|
||||
'mapping. Can be one of %(choices)s. '
|
||||
'Default: %(default)s ')
|
||||
|
||||
parser.add_argument('--gcp',
|
||||
metavar='<path string>',
|
||||
action=StoreValue,
|
||||
|
@ -496,7 +464,7 @@ def config(argv=None, parser=None):
|
|||
action=StoreValue,
|
||||
default=None,
|
||||
help=('Path to the image geolocation file containing the camera center coordinates used for georeferencing. '
|
||||
'Note that omega/phi/kappa are currently not supported (you can set them to 0). '
|
||||
'If you don''t have values for omega/phi/kappa you can set them to 0. '
|
||||
'The file needs to '
|
||||
'use the following format: \n'
|
||||
'EPSG:<code> or <+proj definition>\n'
|
||||
|
@ -570,13 +538,6 @@ def config(argv=None, parser=None):
|
|||
help=('Orthophoto resolution in cm / pixel. Note that this value is capped by a ground sampling distance (GSD) estimate. To remove the cap, check --ignore-gsd also. '
|
||||
'Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--orthophoto-no-tiled',
|
||||
action=StoreTrue,
|
||||
nargs=0,
|
||||
default=False,
|
||||
help='Set this parameter if you want a striped GeoTIFF. '
|
||||
'Default: %(default)s')
|
||||
|
||||
parser.add_argument('--orthophoto-png',
|
||||
action=StoreTrue,
|
||||
nargs=0,
|
||||
|
@ -590,7 +551,6 @@ def config(argv=None, parser=None):
|
|||
default=False,
|
||||
help='Set this parameter if you want to generate a Google Earth (KMZ) rendering of the orthophoto. '
|
||||
'Default: %(default)s')
|
||||
|
||||
|
||||
parser.add_argument('--orthophoto-compression',
|
||||
metavar='<string>',
|
||||
|
@ -659,19 +619,6 @@ def config(argv=None, parser=None):
|
|||
action=StoreValue,
|
||||
help='Copy output results to this folder after processing.')
|
||||
|
||||
parser.add_argument('--time',
|
||||
action=StoreTrue,
|
||||
nargs=0,
|
||||
default=False,
|
||||
help='Generates a benchmark file with runtime info. '
|
||||
'Default: %(default)s')
|
||||
|
||||
parser.add_argument('--debug',
|
||||
action=StoreTrue,
|
||||
nargs=0,
|
||||
default=False,
|
||||
help='Print debug messages. Default: %(default)s')
|
||||
|
||||
parser.add_argument('--version',
|
||||
action='version',
|
||||
version='ODM {0}'.format(__version__),
|
||||
|
|
|
@ -380,5 +380,4 @@ def window_filter_2d(arr, nodata, window, kernel_size, filter):
|
|||
win_arr = filter(win_arr)
|
||||
win_arr[nodata_locs] = nodata
|
||||
win_arr = win_arr[window[0] - expanded_window[0] : window[2] - expanded_window[0], window[1] - expanded_window[1] : window[3] - expanded_window[1]]
|
||||
log.ODM_DEBUG("Filtered window: %s" % str(window))
|
||||
return win_arr
|
||||
|
|
|
@ -43,7 +43,6 @@ def memory():
|
|||
|
||||
class ODMLogger:
|
||||
def __init__(self):
|
||||
self.show_debug = False
|
||||
self.json = None
|
||||
self.json_output_file = None
|
||||
self.start_time = datetime.datetime.now()
|
||||
|
@ -134,10 +133,6 @@ class ODMLogger:
|
|||
def exception(self, msg):
|
||||
self.log(FAIL, msg, "EXCEPTION")
|
||||
|
||||
def debug(self, msg):
|
||||
if self.show_debug:
|
||||
self.log(OKGREEN, msg, "DEBUG")
|
||||
|
||||
def close(self):
|
||||
if self.json is not None and self.json_output_file is not None:
|
||||
try:
|
||||
|
@ -154,4 +149,3 @@ ODM_INFO = logger.info
|
|||
ODM_WARNING = logger.warning
|
||||
ODM_ERROR = logger.error
|
||||
ODM_EXCEPTION = logger.exception
|
||||
ODM_DEBUG = logger.debug
|
||||
|
|
|
@ -18,7 +18,7 @@ from osgeo import gdal
|
|||
|
||||
def get_orthophoto_vars(args):
|
||||
return {
|
||||
'TILED': 'NO' if args.orthophoto_no_tiled else 'YES',
|
||||
'TILED': 'YES',
|
||||
'COMPRESS': args.orthophoto_compression,
|
||||
'PREDICTOR': '2' if args.orthophoto_compression in ['LZW', 'DEFLATE'] else '1',
|
||||
'BIGTIFF': 'IF_SAFER',
|
||||
|
|
|
@ -166,10 +166,6 @@ class ODM_Photo:
|
|||
# parse values from metadata
|
||||
self.parse_exif_values(path_file)
|
||||
|
||||
# print log message
|
||||
log.ODM_DEBUG('Loaded {}'.format(self))
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return '{} | camera: {} {} | dimensions: {} x {} | lat: {} | lon: {} | alt: {} | band: {} ({})'.format(
|
||||
self.filename, self.camera_make, self.camera_model, self.width, self.height,
|
||||
|
|
|
@ -41,7 +41,7 @@ def extract_temperatures_dji(photo, image, dataset_tree):
|
|||
except ValueError as e:
|
||||
log.ODM_ERROR("Error during extracting temperature values for file %s : %s" % photo.filename, e)
|
||||
else:
|
||||
log.ODM_DEBUG("Only DJI M2EA currently supported, please wait for new updates")
|
||||
log.ODM_WARNING("Only DJI M2EA currently supported, please wait for new updates")
|
||||
return image
|
||||
# Extract raw sensor values from generated image into numpy array
|
||||
raw_sensor_np = np.array(img)
|
||||
|
|
|
@ -364,8 +364,10 @@ class ODM_Stage:
|
|||
if outputs.get('tree') is None:
|
||||
raise Exception("Assert violation: tree variable is missing from outputs dictionary.")
|
||||
|
||||
if self.args.time:
|
||||
try:
|
||||
system.benchmark(start_time, outputs['tree'].benchmarking, self.name)
|
||||
except Exception as e:
|
||||
log.ODM_WARNING("Cannot write benchmark file: %s" % str(e))
|
||||
|
||||
log.ODM_INFO('Finished %s stage' % self.name)
|
||||
self.update_progress_end()
|
||||
|
|
|
@ -5,37 +5,33 @@ from osgeo import gdal
|
|||
from opendm.loghelpers import double_quote
|
||||
|
||||
def get_depthmap_resolution(args, photos):
|
||||
if 'depthmap_resolution_is_set' in args:
|
||||
# Override pc-quality
|
||||
return int(args.depthmap_resolution)
|
||||
max_dims = find_largest_photo_dims(photos)
|
||||
min_dim = 320 # Never go lower than this
|
||||
|
||||
if max_dims is not None:
|
||||
w, h = max_dims
|
||||
max_dim = max(w, h)
|
||||
|
||||
megapixels = (w * h) / 1e6
|
||||
multiplier = 1
|
||||
|
||||
if megapixels < 6:
|
||||
multiplier = 2
|
||||
elif megapixels > 42:
|
||||
multiplier = 0.5
|
||||
|
||||
pc_quality_scale = {
|
||||
'ultra': 0.5,
|
||||
'high': 0.25,
|
||||
'medium': 0.125,
|
||||
'low': 0.0675,
|
||||
'lowest': 0.03375
|
||||
}
|
||||
|
||||
return max(min_dim, int(max_dim * pc_quality_scale[args.pc_quality] * multiplier))
|
||||
else:
|
||||
max_dims = find_largest_photo_dims(photos)
|
||||
min_dim = 320 # Never go lower than this
|
||||
|
||||
if max_dims is not None:
|
||||
w, h = max_dims
|
||||
max_dim = max(w, h)
|
||||
|
||||
megapixels = (w * h) / 1e6
|
||||
multiplier = 1
|
||||
|
||||
if megapixels < 6:
|
||||
multiplier = 2
|
||||
elif megapixels > 42:
|
||||
multiplier = 0.5
|
||||
|
||||
pc_quality_scale = {
|
||||
'ultra': 0.5,
|
||||
'high': 0.25,
|
||||
'medium': 0.125,
|
||||
'low': 0.0675,
|
||||
'lowest': 0.03375
|
||||
}
|
||||
|
||||
return max(min_dim, int(max_dim * pc_quality_scale[args.pc_quality] * multiplier))
|
||||
else:
|
||||
log.ODM_WARNING("Cannot compute max image dimensions, going with default depthmap_resolution of 640")
|
||||
return 640 # Sensible default
|
||||
log.ODM_WARNING("Cannot compute max image dimensions, going with default depthmap_resolution of 640")
|
||||
return 640 # Sensible default
|
||||
|
||||
def get_raster_stats(geotiff):
|
||||
stats = []
|
||||
|
|
|
@ -49,12 +49,15 @@ class ODMLoadDatasetStage(types.ODM_Stage):
|
|||
tree = types.ODM_Tree(args.project_path, args.gcp, args.geo)
|
||||
outputs['tree'] = tree
|
||||
|
||||
if args.time and io.file_exists(tree.benchmarking):
|
||||
if io.file_exists(tree.benchmarking):
|
||||
# Delete the previously made file
|
||||
os.remove(tree.benchmarking)
|
||||
with open(tree.benchmarking, 'a') as b:
|
||||
b.write('ODM Benchmarking file created %s\nNumber of Cores: %s\n\n' % (system.now(), context.num_cores))
|
||||
|
||||
try:
|
||||
os.remove(tree.benchmarking)
|
||||
with open(tree.benchmarking, 'a') as b:
|
||||
b.write('ODM Benchmarking file created %s\nNumber of Cores: %s\n\n' % (system.now(), context.num_cores))
|
||||
except Exception as e:
|
||||
log.ODM_WARNING("Cannot write benchmark file: %s" % str(e))
|
||||
|
||||
# check if the image filename is supported
|
||||
def valid_image_filename(filename):
|
||||
(pathfn, ext) = os.path.splitext(filename)
|
||||
|
@ -62,7 +65,6 @@ class ODMLoadDatasetStage(types.ODM_Stage):
|
|||
|
||||
# Get supported images from dir
|
||||
def get_images(in_dir):
|
||||
log.ODM_DEBUG(in_dir)
|
||||
entries = os.listdir(in_dir)
|
||||
valid, rejects = [], []
|
||||
for f in entries:
|
||||
|
|
|
@ -93,12 +93,12 @@ class ODMMvsTexStage(types.ODM_Stage):
|
|||
'bin': context.mvstex_path,
|
||||
'out_dir': os.path.join(r['out_dir'], "odm_textured_model_geo"),
|
||||
'model': r['model'],
|
||||
'dataTerm': args.texturing_data_term,
|
||||
'outlierRemovalType': args.texturing_outlier_removal_type,
|
||||
'dataTerm': 'gmi',
|
||||
'outlierRemovalType': 'gauss_clamping',
|
||||
'skipGlobalSeamLeveling': skipGlobalSeamLeveling,
|
||||
'skipLocalSeamLeveling': skipLocalSeamLeveling,
|
||||
'keepUnseenFaces': keepUnseenFaces,
|
||||
'toneMapping': args.texturing_tone_mapping,
|
||||
'toneMapping': 'none',
|
||||
'nadirMode': nadir,
|
||||
'maxTextureSize': '--max_texture_size=%s' % max_texture_size,
|
||||
'nvm_file': r['nvm_file'],
|
||||
|
|
|
@ -26,9 +26,6 @@ class ODMApp:
|
|||
"""
|
||||
Initializes the application and defines the ODM application pipeline stages
|
||||
"""
|
||||
if args.debug:
|
||||
log.logger.show_debug = True
|
||||
|
||||
json_log_paths = [os.path.join(args.project_path, "log.json")]
|
||||
if args.copy_to:
|
||||
json_log_paths.append(args.copy_to)
|
||||
|
|
Ładowanie…
Reference in New Issue