pull/1233/head
Piero Toffanin 2021-02-24 16:14:59 -05:00
rodzic 8e2577090a
commit c87c21dc03
8 zmienionych plików z 29 dodań i 33 usunięć

Wyświetl plik

@ -1 +1 @@
2.4.3 2.4.4

Wyświetl plik

@ -505,8 +505,7 @@ class ToolchainTask(Task):
"odm_orthophoto/odm_orthophoto_feathered.tif", "odm_orthophoto/odm_orthophoto_feathered.tif",
"odm_dem", "odm_dem",
"odm_report", "odm_report",
"odm_georeferencing", "odm_georeferencing"])
"odm_georeferencing_25d"])
else: else:
log.ODM_INFO("Already processed toolchain for %s" % submodel_name) log.ODM_INFO("Already processed toolchain for %s" % submodel_name)
handle_result() handle_result()

Wyświetl plik

@ -81,11 +81,12 @@ def get_geojson_shots_from_opensfm(reconstruction_file, utm_offset=None, pseudo_
else: else:
# Rotation is already in the proper CRS # Rotation is already in the proper CRS
rotation = shot['rotation'] rotation = shot['rotation']
translation = shot['translation']
# Just add UTM offset # Just add UTM offset
translation = [shot['translation'][0] + utm_offset[0], trans_coords = [translation[0] + utm_offset[0],
shot['translation'][1] + utm_offset[1], translation[1] + utm_offset[1],
shot['translation'][2]] translation[2]]
feats.append({ feats.append({
'type': 'Feature', 'type': 'Feature',

Wyświetl plik

@ -220,7 +220,6 @@ class ODM_Tree(object):
self.odm_texturing = os.path.join(self.root_path, 'odm_texturing') self.odm_texturing = os.path.join(self.root_path, 'odm_texturing')
self.odm_25dtexturing = os.path.join(self.root_path, 'odm_texturing_25d') self.odm_25dtexturing = os.path.join(self.root_path, 'odm_texturing_25d')
self.odm_georeferencing = os.path.join(self.root_path, 'odm_georeferencing') self.odm_georeferencing = os.path.join(self.root_path, 'odm_georeferencing')
self.odm_25dgeoreferencing = os.path.join(self.root_path, 'odm_georeferencing_25d')
self.odm_filterpoints = os.path.join(self.root_path, 'odm_filterpoints') self.odm_filterpoints = os.path.join(self.root_path, 'odm_filterpoints')
self.odm_orthophoto = os.path.join(self.root_path, 'odm_orthophoto') self.odm_orthophoto = os.path.join(self.root_path, 'odm_orthophoto')
self.odm_report = os.path.join(self.root_path, 'odm_report') self.odm_report = os.path.join(self.root_path, 'odm_report')
@ -260,7 +259,8 @@ class ODM_Tree(object):
self.odm_geo_file = geo_file or io.find('geo.txt', self.root_path) self.odm_geo_file = geo_file or io.find('geo.txt', self.root_path)
self.odm_georeferencing_proj = 'proj.txt' self.odm_georeferencing_proj = 'proj.txt'
self.odm_georeferencing_model_txt_geo = 'odm_georeferencing_model_geo.txt' self.odm_georeferencing_model_txt_geo = os.path.join(
self.odm_georeferencing, 'odm_georeferencing_model_geo.txt')
self.odm_georeferencing_xyz_file = os.path.join( self.odm_georeferencing_xyz_file = os.path.join(
self.odm_georeferencing, 'odm_georeferenced_model.csv') self.odm_georeferencing, 'odm_georeferenced_model.csv')
self.odm_georeferencing_model_laz = os.path.join( self.odm_georeferencing_model_laz = os.path.join(

1
run.py
Wyświetl plik

@ -51,7 +51,6 @@ if __name__ == '__main__':
os.system("rm -rf " + os.system("rm -rf " +
" ".join([ " ".join([
quote(os.path.join(args.project_path, "odm_georeferencing")), quote(os.path.join(args.project_path, "odm_georeferencing")),
quote(os.path.join(args.project_path, "odm_georeferencing_25d")),
quote(os.path.join(args.project_path, "odm_meshing")), quote(os.path.join(args.project_path, "odm_meshing")),
quote(os.path.join(args.project_path, "odm_orthophoto")), quote(os.path.join(args.project_path, "odm_orthophoto")),
quote(os.path.join(args.project_path, "odm_dem")), quote(os.path.join(args.project_path, "odm_dem")),

Wyświetl plik

@ -84,7 +84,6 @@ class ODMLoadDatasetStage(types.ODM_Stage):
# define paths and create working directories # define paths and create working directories
system.mkdir_p(tree.odm_georeferencing) system.mkdir_p(tree.odm_georeferencing)
if not args.use_3dmesh: system.mkdir_p(tree.odm_25dgeoreferencing)
log.ODM_INFO('Loading dataset from: %s' % images_dir) log.ODM_INFO('Loading dataset from: %s' % images_dir)

Wyświetl plik

@ -27,7 +27,7 @@ class ODMMvsTexStage(types.ODM_Stage):
'nadir': False, 'nadir': False,
'primary': primary, 'primary': primary,
'nvm_file': nvm_file, 'nvm_file': nvm_file,
'labeling_file': os.path.join(tree.odm_texturing, "odm_textured_model_labeling.vec") if subdir else None 'labeling_file': os.path.join(tree.odm_texturing, "odm_textured_model_geo_labeling.vec") if subdir else None
}] }]
if not args.use_3dmesh: if not args.use_3dmesh:
@ -37,7 +37,7 @@ class ODMMvsTexStage(types.ODM_Stage):
'nadir': True, 'nadir': True,
'primary': primary, 'primary': primary,
'nvm_file': nvm_file, 'nvm_file': nvm_file,
'labeling_file': os.path.join(tree.odm_25dtexturing, "odm_textured_model_labeling.vec") if subdir else None 'labeling_file': os.path.join(tree.odm_25dtexturing, "odm_textured_model_geo_labeling.vec") if subdir else None
}] }]
if reconstruction.multi_camera: if reconstruction.multi_camera:
@ -80,7 +80,7 @@ class ODMMvsTexStage(types.ODM_Stage):
# mvstex definitions # mvstex definitions
kwargs = { kwargs = {
'bin': context.mvstex_path, 'bin': context.mvstex_path,
'out_dir': os.path.join(r['out_dir'], "odm_textured_model"), 'out_dir': os.path.join(r['out_dir'], "odm_textured_model_geo"),
'model': r['model'], 'model': r['model'],
'dataTerm': self.params.get('data_term'), 'dataTerm': self.params.get('data_term'),
'outlierRemovalType': self.params.get('outlier_rem_type'), 'outlierRemovalType': self.params.get('outlier_rem_type'),

Wyświetl plik

@ -16,29 +16,27 @@ class ODMGeoreferencingStage(types.ODM_Stage):
tree = outputs['tree'] tree = outputs['tree']
reconstruction = outputs['reconstruction'] reconstruction = outputs['reconstruction']
if io.file_exists(tree.odm_georeferencing_model_laz) or self.rerun(): if not io.file_exists(tree.odm_georeferencing_model_laz) or self.rerun():
kwargs = { cmd = ('pdal translate -i "%s" -o \"%s\"' % (tree.filtered_point_cloud, tree.odm_georeferencing_model_laz))
'inputFile': tree.filtered_point_cloud, stages = ["ferry"]
'outputFile': tree.odm_georeferencing_model_laz, params = [
} '--filters.ferry.dimensions="views => UserData"',
cmd = ('pdal translate -i "{inputFile}" ' '--writers.las.compression="lazip"',
'-o \"{outputFile}\" ' ]
'ferry '
'--filters.ferry.dimensions="views => UserData" '
'--writers.las.compression="lazip" '.format(**kwargs))
if reconstruction.is_georeferenced(): if reconstruction.is_georeferenced():
log.ODM_INFO("Georeferencing point cloud") log.ODM_INFO("Georeferencing point cloud")
kwargs = {
'offset_x': reconstruction.georef.utm_east_offset,
'offset_y': reconstruction.georef.utm_north_offset,
'srs': reconstruction.georef.proj4()
}
system.run(cmd + '--writers.las.offset_x={offset_x} ' stages.append("transformation")
'--writers.las.offset_y={offset_y} ' params += [
'--writers.las.offset_z=0 ' '--filters.transformation.matrix="1 0 0 %s 0 1 0 %s 0 0 1 0 0 0 0 1"' % reconstruction.georef.utm_offset(),
'--writers.las.a_srs="{srs}" '.format(**kwargs)) '--writers.las.offset_x=%s' % reconstruction.georef.utm_east_offset,
'--writers.las.offset_y=%s' % reconstruction.georef.utm_north_offset,
'--writers.las.offset_z=0',
'--writers.las.a_srs="%s"' % reconstruction.georef.proj4()
]
system.run(cmd + ' ' + ' '.join(stages) + ' ' + ' '.join(params))
self.update_progress(50) self.update_progress(50)
@ -64,7 +62,7 @@ class ODMGeoreferencingStage(types.ODM_Stage):
args.crop = 0 args.crop = 0
else: else:
log.ODM_INFO("Converting point cloud (non-georeferenced)") log.ODM_INFO("Converting point cloud (non-georeferenced)")
system.run(cmd) system.run(cmd + ' ' + ' '.join(stages) + ' ' + ' '.join(params))
point_cloud.post_point_cloud_steps(args, tree) point_cloud.post_point_cloud_steps(args, tree)
else: else: