kopia lustrzana https://github.com/OpenDroneMap/ODM
commit
01fb2b259e
|
@ -395,6 +395,21 @@ def config(argv=None, parser=None):
|
||||||
help='Improve the accuracy of the point cloud by computing geometrically consistent depthmaps. This increases processing time, but can improve results in urban scenes. '
|
help='Improve the accuracy of the point cloud by computing geometrically consistent depthmaps. This increases processing time, but can improve results in urban scenes. '
|
||||||
'Default: %(default)s')
|
'Default: %(default)s')
|
||||||
|
|
||||||
|
parser.add_argument('--pc-sharp',
|
||||||
|
action=StoreTrue,
|
||||||
|
nargs=0,
|
||||||
|
default=False,
|
||||||
|
help='Improve the accuracy of the point cloud by applying filters to sharpen the pointcloud, but reduces the completeness of the reconstruction. '
|
||||||
|
'Default: %(default)s')
|
||||||
|
|
||||||
|
parser.add_argument('--pc-subreslevel',
|
||||||
|
metavar='<positive integer>',
|
||||||
|
action=StoreValue,
|
||||||
|
default=2,
|
||||||
|
type=int,
|
||||||
|
help=('The number of lower resolutions to process before estimating output resolution depthmap. '
|
||||||
|
'Default: %(default)s'))
|
||||||
|
|
||||||
parser.add_argument('--smrf-scalar',
|
parser.add_argument('--smrf-scalar',
|
||||||
metavar='<positive float>',
|
metavar='<positive float>',
|
||||||
action=StoreValue,
|
action=StoreValue,
|
||||||
|
|
|
@ -59,13 +59,16 @@ class ODMOpenMVSStage(types.ODM_Stage):
|
||||||
|
|
||||||
log.ODM_INFO("Estimating depthmaps")
|
log.ODM_INFO("Estimating depthmaps")
|
||||||
number_views_fuse = 2
|
number_views_fuse = 2
|
||||||
|
densify_ini_file = os.path.join(tree.openmvs, 'Densify.ini')
|
||||||
|
|
||||||
config = [
|
config = [
|
||||||
" --resolution-level %s" % int(resolution_level),
|
" --resolution-level %s" % int(resolution_level),
|
||||||
|
'--dense-config-file "%s"' % densify_ini_file,
|
||||||
"--min-resolution %s" % depthmap_resolution,
|
"--min-resolution %s" % depthmap_resolution,
|
||||||
"--max-resolution %s" % int(outputs['undist_image_max_size']),
|
"--max-resolution %s" % int(outputs['undist_image_max_size']),
|
||||||
"--max-threads %s" % args.max_concurrency,
|
"--max-threads %s" % args.max_concurrency,
|
||||||
"--number-views-fuse %s" % number_views_fuse,
|
"--number-views-fuse %s" % number_views_fuse,
|
||||||
|
"--sub-resolution-levels %s" % args.pc_subreslevel,
|
||||||
'-w "%s"' % depthmaps_dir,
|
'-w "%s"' % depthmaps_dir,
|
||||||
"-v 0"
|
"-v 0"
|
||||||
]
|
]
|
||||||
|
@ -73,7 +76,7 @@ class ODMOpenMVSStage(types.ODM_Stage):
|
||||||
gpu_config = []
|
gpu_config = []
|
||||||
|
|
||||||
if not has_gpu():
|
if not has_gpu():
|
||||||
gpu_config.append("--cuda-device -1")
|
gpu_config.append("--cuda-device -2")
|
||||||
|
|
||||||
if args.pc_tile:
|
if args.pc_tile:
|
||||||
config.append("--fusion-mode 1")
|
config.append("--fusion-mode 1")
|
||||||
|
@ -81,6 +84,13 @@ class ODMOpenMVSStage(types.ODM_Stage):
|
||||||
if not args.pc_geometric:
|
if not args.pc_geometric:
|
||||||
config.append("--geometric-iters 0")
|
config.append("--geometric-iters 0")
|
||||||
|
|
||||||
|
if args.pc_sharp:
|
||||||
|
with open(densify_ini_file, 'w+') as f:
|
||||||
|
f.write("Optimize = 7\n")
|
||||||
|
else:
|
||||||
|
with open(densify_ini_file, 'w+') as f:
|
||||||
|
f.write("Optimize = 3\n")
|
||||||
|
|
||||||
def run_densify():
|
def run_densify():
|
||||||
system.run('"%s" "%s" %s' % (context.omvs_densify_path,
|
system.run('"%s" "%s" %s' % (context.omvs_densify_path,
|
||||||
openmvs_scene_file,
|
openmvs_scene_file,
|
||||||
|
@ -93,7 +103,7 @@ class ODMOpenMVSStage(types.ODM_Stage):
|
||||||
# try to run it again without GPU
|
# try to run it again without GPU
|
||||||
if e.errorCode == 1 and len(gpu_config) == 0:
|
if e.errorCode == 1 and len(gpu_config) == 0:
|
||||||
log.ODM_WARNING("OpenMVS failed with GPU, is your graphics card driver up to date? Falling back to CPU.")
|
log.ODM_WARNING("OpenMVS failed with GPU, is your graphics card driver up to date? Falling back to CPU.")
|
||||||
gpu_config.append("--cuda-device -1")
|
gpu_config.append("--cuda-device -2")
|
||||||
run_densify()
|
run_densify()
|
||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
|
|
Ładowanie…
Reference in New Issue