kopia lustrzana https://github.com/OpenDroneMap/ODM
add filtering to ply
rodzic
fa7c29d01f
commit
852e09551e
|
@ -6,26 +6,6 @@ from opendm import system
|
||||||
from opendm import context
|
from opendm import context
|
||||||
from opendm import point_cloud
|
from opendm import point_cloud
|
||||||
|
|
||||||
|
|
||||||
#class PDAL(ecto.Cell):
|
|
||||||
#
|
|
||||||
# def declare_params(self, params):
|
|
||||||
# params.declare("mve_filter_range", "min confidence value", 0.5)
|
|
||||||
#
|
|
||||||
# def declare_io(self, params, inputs, outputs):
|
|
||||||
#
|
|
||||||
# #pdal confi
|
|
||||||
# config = [
|
|
||||||
# 'translate -i %s',
|
|
||||||
# '-o %s',
|
|
||||||
# '-f range',
|
|
||||||
# '%s' % args.mve_filter_range
|
|
||||||
# #'--filters.range.limits="confidence[0.25:1]"'
|
|
||||||
# ]
|
|
||||||
#
|
|
||||||
# # run pdal
|
|
||||||
# system.run('%s %s %s %s' % (context.pdal_path_pc, ' '.join(config), tree.mve_model, tree.mve_model_output))
|
|
||||||
|
|
||||||
class ODMMveCell(ecto.Cell):
|
class ODMMveCell(ecto.Cell):
|
||||||
|
|
||||||
def declare_params(self, params):
|
def declare_params(self, params):
|
||||||
|
@ -109,19 +89,8 @@ class ODMMveCell(ecto.Cell):
|
||||||
# run scene2pset
|
# run scene2pset
|
||||||
system.run('%s %s %s %s' % (context.mve_path_pc, ' '.join(config), tree.mve, tree.mve_model))
|
system.run('%s %s %s %s' % (context.mve_path_pc, ' '.join(config), tree.mve, tree.mve_model))
|
||||||
|
|
||||||
#pdal config
|
|
||||||
config = [
|
|
||||||
"translate -i /home/useruser/ODMProjects/set16/mve/mve_dense_point_cloud.ply",
|
|
||||||
"-o /home/useruser/ODMProjects/set16/mve",
|
|
||||||
"-f range",
|
|
||||||
#'%s' % args.mve_filter_range
|
|
||||||
'--filters.range.limits="confidence[0.25:1]"'
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
# run pdal
|
# run pdal
|
||||||
system.run('%s %s %s %s %s %s' % (context.pdal_path_pc, ' translate -i ', tree.mve_model, '-o ', tree.mve_model_output, ' -f range --filters.range.limits="confidence[0.25:1]"'))
|
system.run('%s %s %s %s %s %s' % (context.pdal_path_pc, ' translate -i ', tree.mve_model, '-o ', tree.mve_model_output, ' -f range --filters.range.limits="confidence[0.25:1]"'))
|
||||||
|
|
||||||
|
|
||||||
# find and rename the output file for simplicity
|
# find and rename the output file for simplicity
|
||||||
mve_files = glob.glob(os.path.join(tree.mve, 'mve-*'))
|
mve_files = glob.glob(os.path.join(tree.mve, 'mve-*'))
|
||||||
|
@ -132,7 +101,7 @@ class ODMMveCell(ecto.Cell):
|
||||||
log.ODM_WARNING("File %s does not exist, cannot be renamed. " % old_file)
|
log.ODM_WARNING("File %s does not exist, cannot be renamed. " % old_file)
|
||||||
|
|
||||||
# Filter
|
# Filter
|
||||||
point_cloud.filter(tree.smvs_model, standard_deviation=args.pc_filter, verbose=args.verbose)
|
point_cloud.filter(tree.mve_model_output, standard_deviation=args.pc_filter, verbose=args.verbose)
|
||||||
else:
|
else:
|
||||||
log.ODM_WARNING("Cannot find a valid point cloud (mve-XX.ply) in %s. Check the console output for errors." % tree.mve)
|
log.ODM_WARNING("Cannot find a valid point cloud (mve-XX.ply) in %s. Check the console output for errors." % tree.mve)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ODMeshingCell(ecto.Cell):
|
||||||
(args.rerun_from is not None and
|
(args.rerun_from is not None and
|
||||||
'odm_meshing' in args.rerun_from)
|
'odm_meshing' in args.rerun_from)
|
||||||
|
|
||||||
infile = tree.mve_model
|
infile = tree.mve_model_output
|
||||||
if args.fast_orthophoto:
|
if args.fast_orthophoto:
|
||||||
infile = os.path.join(tree.opensfm, 'reconstruction.ply')
|
infile = os.path.join(tree.opensfm, 'reconstruction.ply')
|
||||||
elif args.use_opensfm_dense:
|
elif args.use_opensfm_dense:
|
||||||
|
|
Ładowanie…
Reference in New Issue