kopia lustrzana https://github.com/OpenDroneMap/ODM
Merge pull request #1215 from pierotofy/231
Re-run bug fix, --pc-quality changespull/1221/head v2.3.1
commit
84ff35226b
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.3.0
|
||||
2.3.1
|
||||
|
|
|
@ -370,7 +370,7 @@ def config(argv=None, parser=None):
|
|||
metavar='<string>',
|
||||
action=StoreValue,
|
||||
default='medium',
|
||||
choices=['ultra', 'high', 'medium', 'low'],
|
||||
choices=['ultra', 'high', 'medium', 'low', 'lowest'],
|
||||
help=('Set point cloud quality. Higher quality generates better, denser point clouds, but requires more memory and takes longer. Each step up in quality increases processing time roughly by a factor of 4x.'
|
||||
'Can be one of: %(choices)s. Default: '
|
||||
'%(default)s'))
|
||||
|
|
|
@ -8,16 +8,18 @@ def get_depthmap_resolution(args, photos):
|
|||
return int(args.depthmap_resolution)
|
||||
else:
|
||||
max_dim = find_largest_photo_dim(photos)
|
||||
min_dim = 320 # Never go lower than this
|
||||
|
||||
pc_quality_scale = {
|
||||
'ultra': 0.5,
|
||||
'high': 0.25,
|
||||
'medium': 0.125,
|
||||
'low': 0.0675
|
||||
'ultra': 1,
|
||||
'high': 0.5,
|
||||
'medium': 0.25,
|
||||
'low': 0.125,
|
||||
'lowest': 0.0675
|
||||
}
|
||||
|
||||
if max_dim > 0:
|
||||
return int(max_dim * pc_quality_scale[args.pc_quality])
|
||||
return max(min_dim, int(max_dim * pc_quality_scale[args.pc_quality]))
|
||||
else:
|
||||
log.ODM_WARNING("Cannot compute max image dimensions, going with default depthmap_resolution of 640")
|
||||
return 640 # Sensible default
|
||||
|
|
|
@ -38,7 +38,6 @@ class ODMOpenMVSStage(types.ODM_Stage):
|
|||
os.mkdir(depthmaps_dir)
|
||||
|
||||
depthmap_resolution = get_depthmap_resolution(args, photos)
|
||||
|
||||
if outputs["undist_image_max_size"] <= depthmap_resolution:
|
||||
resolution_level = 0
|
||||
else:
|
||||
|
|
|
@ -147,22 +147,31 @@ class ODMOpenSfMStage(types.ODM_Stage):
|
|||
for band in reconstruction.multi_camera:
|
||||
nvm_file = octx.path("undistorted", "reconstruction_%s.nvm" % band['name'].lower())
|
||||
|
||||
img_map = {}
|
||||
for fname in p2s:
|
||||
if not io.file_exists(nvm_file) or self.rerun():
|
||||
img_map = {}
|
||||
|
||||
if primary_band_name is None:
|
||||
primary_band_name = multispectral.get_primary_band_name(reconstruction.multi_camera, args.primary_band)
|
||||
if p2s is None:
|
||||
s2p, p2s = multispectral.compute_band_maps(reconstruction.multi_camera, primary_band_name)
|
||||
|
||||
# Primary band maps to itself
|
||||
if band['name'] == primary_band_name:
|
||||
img_map[fname + '.tif'] = fname + '.tif'
|
||||
else:
|
||||
band_filename = next((p.filename for p in p2s[fname] if p.band_name == band['name']), None)
|
||||
|
||||
if band_filename is not None:
|
||||
img_map[fname + '.tif'] = band_filename + '.tif'
|
||||
for fname in p2s:
|
||||
|
||||
# Primary band maps to itself
|
||||
if band['name'] == primary_band_name:
|
||||
img_map[fname + '.tif'] = fname + '.tif'
|
||||
else:
|
||||
log.ODM_WARNING("Cannot find %s band equivalent for %s" % (band, fname))
|
||||
band_filename = next((p.filename for p in p2s[fname] if p.band_name == band['name']), None)
|
||||
|
||||
nvm.replace_nvm_images(tree.opensfm_reconstruction_nvm, img_map, nvm_file)
|
||||
if band_filename is not None:
|
||||
img_map[fname + '.tif'] = band_filename + '.tif'
|
||||
else:
|
||||
log.ODM_WARNING("Cannot find %s band equivalent for %s" % (band, fname))
|
||||
|
||||
nvm.replace_nvm_images(tree.opensfm_reconstruction_nvm, img_map, nvm_file)
|
||||
else:
|
||||
log.ODM_WARNING("Found existing NVM file %s" % nvm_file)
|
||||
|
||||
self.update_progress(85)
|
||||
|
||||
# Skip dense reconstruction if necessary and export
|
||||
|
|
Ładowanie…
Reference in New Issue