kopia lustrzana https://github.com/OpenDroneMap/ODM
rodzic
6effb49d82
commit
a67230e4ae
|
@ -38,8 +38,8 @@ def create_25dmesh(inPointCloud, outMesh, dsm_resolution=0.05, depth=8, samples=
|
|||
mesh = screened_poisson_reconstruction(dsm_points, outMesh, depth=depth, samples=samples, verbose=verbose)
|
||||
|
||||
# Cleanup tmp
|
||||
#if os.path.exists(tmp_directory):
|
||||
# shutil.rmtree(tmp_directory)
|
||||
if os.path.exists(tmp_directory):
|
||||
shutil.rmtree(tmp_directory)
|
||||
|
||||
return mesh
|
||||
|
||||
|
|
|
@ -88,26 +88,12 @@ class ODMeshingCell(ecto.Cell):
|
|||
if args.use_25dmesh:
|
||||
if not io.file_exists(tree.odm_25dmesh) or rerun_cell:
|
||||
|
||||
# TODO
|
||||
|
||||
log.ODM_DEBUG('Writing ODM 2.5D Mesh file in: %s' % tree.odm_25dmesh)
|
||||
|
||||
kwargs = {
|
||||
'bin': context.odm_modules_path,
|
||||
'outfile': tree.odm_25dmesh,
|
||||
'infile': infile,
|
||||
'log': tree.odm_25dmeshing_log,
|
||||
'verbose': verbose,
|
||||
'max_vertex': self.params.max_vertex,
|
||||
'neighbors': args.mesh_neighbors,
|
||||
'resolution': args.mesh_resolution
|
||||
}
|
||||
|
||||
# run 2.5D meshing binary
|
||||
system.run('{bin}/odm_25dmeshing -inputFile {infile} '
|
||||
'-outputFile {outfile} -logFile {log} '
|
||||
'-maxVertexCount {max_vertex} -neighbors {neighbors} '
|
||||
'-resolution {resolution} {verbose}'.format(**kwargs))
|
||||
mesh.create_25dmesh(infile, tree.odm_25dmesh,
|
||||
dsm_resolution=args.mesh_resolution,
|
||||
depth=self.params.oct_tree,
|
||||
verbose=self.params.verbose)
|
||||
else:
|
||||
log.ODM_WARNING('Found a valid ODM 2.5D Mesh file in: %s' %
|
||||
tree.odm_25dmesh)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ecto
|
||||
import ecto, shutil
|
||||
|
||||
from opendm import log
|
||||
from opendm import io
|
||||
|
@ -39,8 +39,6 @@ class ODMSmvsCell(ecto.Cell):
|
|||
log.ODM_ERROR('Not enough photos in photos array to start SMVS')
|
||||
return ecto.QUIT
|
||||
|
||||
system.mkdir_p(tree.smvs)
|
||||
|
||||
# check if we rerun cell or not
|
||||
rerun_cell = (args.rerun is not None and
|
||||
args.rerun == 'smvs') or \
|
||||
|
@ -58,6 +56,12 @@ class ODMSmvsCell(ecto.Cell):
|
|||
io.copy(tree.opensfm_image_list, tree.mve_image_list)
|
||||
io.copy(tree.opensfm_bundle, tree.mve_bundle)
|
||||
|
||||
# mve makescene wants the output directory
|
||||
# to not exists before executing it (otherwise it
|
||||
# will prompt the user for confirmation)
|
||||
if io.dir_exists(tree.smvs):
|
||||
shutil.rmtree(tree.smvs)
|
||||
|
||||
# run mve makescene
|
||||
if not io.dir_exists(tree.mve_views):
|
||||
system.run('%s %s %s' % (context.makescene_path, tree.mve_path, tree.smvs))
|
||||
|
|
Ładowanie…
Reference in New Issue