pull/1283/head
Piero Toffanin 2021-04-28 09:09:37 -04:00
commit dcd9c9f0f3
5 zmienionych plików z 26 dodań i 28 usunięć

Wyświetl plik

@ -24,7 +24,7 @@ opensfm_path = os.path.join(superbuild_path, "src/opensfm")
poisson_recon_path = os.path.join(superbuild_bin_path, 'PoissonRecon')
dem2mesh_path = os.path.join(superbuild_bin_path, 'dem2mesh')
dem2points_path = os.path.join(superbuild_path, 'dem2points')
dem2points_path = os.path.join(superbuild_bin_path, 'dem2points')
# define mvstex path
mvstex_path = os.path.join(superbuild_bin_path, "texrecon")

Wyświetl plik

@ -47,18 +47,10 @@ def build_entwine(input_point_cloud_files, tmpdir, output_path, max_concurrency=
'outputdir': output_path
}
# Run scan to compute dataset bounds
system.run('entwine scan --threads {threads} --tmp "{tmpdir}" {all_inputs} -o "{outputdir}"'.format(**kwargs))
scan_json = os.path.join(output_path, "scan.json")
if os.path.exists(scan_json):
kwargs['input'] = scan_json
for _ in range(len(input_point_cloud_files)):
# One at a time
system.run('entwine build --threads {threads} --tmp "{tmpdir}" -i "{input}" -o "{outputdir}" --run 1'.format(**kwargs))
else:
log.ODM_WARNING("%s does not exist, no point cloud will be built." % scan_json)
# for _ in range(len(input_point_cloud_files)):
# # One at a time
# system.run('entwine build --threads {threads} --tmp "{tmpdir}" -i "{input}" -o "{outputdir}"'.format(**kwargs))
system.run('entwine build --threads {threads} --tmp "{tmpdir}" {all_inputs} -o "{outputdir}"'.format(**kwargs))
def build_untwine(input_point_cloud_files, tmpdir, output_path, max_concurrency=8, rerun=False):
kwargs = {

Wyświetl plik

@ -317,29 +317,35 @@ def merge_ply(input_point_cloud_files, output_file, dims=None):
system.run(' '.join(cmd))
def post_point_cloud_steps(args, tree):
def post_point_cloud_steps(args, tree, rerun=False):
# XYZ point cloud output
if args.pc_csv:
log.ODM_INFO("Creating CSV file (XYZ format)")
system.run("pdal translate -i \"{}\" "
"-o \"{}\" "
"--writers.text.format=csv "
"--writers.text.order=\"X,Y,Z\" "
"--writers.text.keep_unspecified=false ".format(
tree.odm_georeferencing_model_laz,
tree.odm_georeferencing_xyz_file))
if not io.file_exists(tree.odm_georeferencing_xyz_file) or rerun:
system.run("pdal translate -i \"{}\" "
"-o \"{}\" "
"--writers.text.format=csv "
"--writers.text.order=\"X,Y,Z\" "
"--writers.text.keep_unspecified=false ".format(
tree.odm_georeferencing_model_laz,
tree.odm_georeferencing_xyz_file))
else:
log.ODM_WARNING("Found existing CSV file %s" % tree.odm_georeferencing_xyz_file)
# LAS point cloud output
if args.pc_las:
log.ODM_INFO("Creating LAS file")
system.run("pdal translate -i \"{}\" "
"-o \"{}\" ".format(
tree.odm_georeferencing_model_laz,
tree.odm_georeferencing_model_las))
if not io.file_exists(tree.odm_georeferencing_model_las) or rerun:
system.run("pdal translate -i \"{}\" "
"-o \"{}\" ".format(
tree.odm_georeferencing_model_laz,
tree.odm_georeferencing_model_las))
else:
log.ODM_WARNING("Found existing LAS file %s" % tree.odm_georeferencing_xyz_file)
# EPT point cloud output
if args.pc_ept:
log.ODM_INFO("Creating Entwine Point Tile output")
entwine.build([tree.odm_georeferencing_model_laz], tree.entwine_pointcloud, max_concurrency=args.max_concurrency, rerun=False)
entwine.build([tree.odm_georeferencing_model_laz], tree.entwine_pointcloud, max_concurrency=args.max_concurrency, rerun=rerun)

Wyświetl plik

@ -64,7 +64,7 @@ class ODMGeoreferencingStage(types.ODM_Stage):
log.ODM_INFO("Converting point cloud (non-georeferenced)")
system.run(cmd + ' ' + ' '.join(stages) + ' ' + ' '.join(params))
point_cloud.post_point_cloud_steps(args, tree)
point_cloud.post_point_cloud_steps(args, tree, self.rerun())
else:
log.ODM_WARNING('Found a valid georeferenced model in: %s'
% tree.odm_georeferencing_model_laz)

Wyświetl plik

@ -252,7 +252,7 @@ class ODMMergeStage(types.ODM_Stage):
try:
point_cloud.merge(all_point_clouds, tree.odm_georeferencing_model_laz, rerun=self.rerun())
point_cloud.post_point_cloud_steps(args, tree)
point_cloud.post_point_cloud_steps(args, tree, self.rerun())
except Exception as e:
log.ODM_WARNING("Could not merge point cloud: %s (skipping)" % str(e))
else: