kopia lustrzana https://github.com/OpenDroneMap/ODM
Merge pull request #599 from fredlllll/georef_transform_file
Addition to georef transform file
Former-commit-id: 66092078dc
pull/1161/head
commit
db2569896d
|
@ -117,6 +117,7 @@ When the process finishes, the results will be organized as follows:
|
|||
|-- odm_georeferenced_model.ply.laz # LAZ format point cloud
|
||||
|-- odm_georeferenced_model.csv # XYZ format point cloud
|
||||
|-- odm_georeferencing_log.txt # Georeferencing log
|
||||
|-- odm_georeferencing_transform.txt# Transform used for georeferencing
|
||||
|-- odm_georeferencing_utm_log.txt # Log for the extract_utm portion
|
||||
|-- odm_orthophoto/
|
||||
|-- odm_orthophoto.png # Orthophoto image (no coordinates)
|
||||
|
|
|
@ -322,6 +322,21 @@ void Georef::parseArguments(int argc, char *argv[])
|
|||
}
|
||||
log_ << "Log file path was set to: " << logFile_ << "\n";
|
||||
}
|
||||
else if (argument == "-outputTransformFile")
|
||||
{
|
||||
++argIndex;
|
||||
if (argIndex >= argc)
|
||||
{
|
||||
throw GeorefException("Missing argument for '" + argument + "'.");
|
||||
}
|
||||
finalTransformFile_ = std::string(argv[argIndex]);
|
||||
std::ofstream testFile(logFile_.c_str());
|
||||
if (!testFile.is_open())
|
||||
{
|
||||
throw GeorefException("Argument '" + argument + "' has a bad value.");
|
||||
}
|
||||
log_ << "Transform file path was set to: " << finalTransformFile_ << "\n";
|
||||
}
|
||||
else if(argument == "-bundleFile" && argIndex < argc)
|
||||
{
|
||||
argIndex++;
|
||||
|
|
|
@ -442,6 +442,7 @@ class ODM_Tree(object):
|
|||
self.odm_georeferencing_utm_log = io.join_paths(
|
||||
self.odm_georeferencing, 'odm_georeferencing_utm_log.txt')
|
||||
self.odm_georeferencing_log = 'odm_georeferencing_log.txt'
|
||||
self.odm_georeferencing_transform_file = 'odm_georeferencing_transform.txt'
|
||||
self.odm_georeferencing_model_txt_geo = 'odm_georeferencing_model_geo.txt'
|
||||
self.odm_georeferencing_model_ply_geo = 'odm_georeferenced_model.ply'
|
||||
self.odm_georeferencing_model_obj_geo = 'odm_textured_model_geo.obj'
|
||||
|
|
|
@ -108,6 +108,7 @@ class ODMGeoreferencingCell(ecto.Cell):
|
|||
odm_georeferencing_model_obj_geo = os.path.join(r['texturing_dir'], tree.odm_georeferencing_model_obj_geo)
|
||||
odm_georeferencing_model_ply_geo = os.path.join(r['georeferencing_dir'], tree.odm_georeferencing_model_ply_geo)
|
||||
odm_georeferencing_log = os.path.join(r['georeferencing_dir'], tree.odm_georeferencing_log)
|
||||
odm_georeferencing_transform_file = os.path.join(r['georeferencing_dir'], tree.odm_georeferencing_transform_file)
|
||||
|
||||
if not io.file_exists(odm_georeferencing_model_obj_geo) or \
|
||||
not io.file_exists(odm_georeferencing_model_ply_geo) or rerun_cell:
|
||||
|
@ -120,6 +121,7 @@ class ODMGeoreferencingCell(ecto.Cell):
|
|||
'imgs_list': tree.opensfm_bundle_list,
|
||||
'model': r['model'],
|
||||
'log': odm_georeferencing_log,
|
||||
'transform_file': odm_georeferencing_transform_file,
|
||||
'coords': tree.odm_georeferencing_coords,
|
||||
'pc_geo': odm_georeferencing_model_ply_geo,
|
||||
'geo_sys': os.path.join(r['georeferencing_dir'], tree.odm_georeferencing_model_txt_geo),
|
||||
|
@ -142,7 +144,7 @@ class ODMGeoreferencingCell(ecto.Cell):
|
|||
system.run('{bin}/odm_georef -bundleFile {bundle} -imagesPath {imgs} -imagesListPath {imgs_list} '
|
||||
'-bundleResizedTo {size} -inputFile {model} -outputFile {model_geo} '
|
||||
'-inputPointCloudFile {pc} -outputPointCloudFile {pc_geo} {verbose} '
|
||||
'-logFile {log} -georefFileOutputPath {geo_sys} -gcpFile {gcp} '
|
||||
'-logFile {log} -outputTransformFile {transform_file} -georefFileOutputPath {geo_sys} -gcpFile {gcp} '
|
||||
'-outputCoordFile {coords}'.format(**kwargs))
|
||||
except Exception:
|
||||
log.ODM_EXCEPTION('Georeferencing failed. ')
|
||||
|
@ -152,7 +154,7 @@ class ODMGeoreferencingCell(ecto.Cell):
|
|||
system.run('{bin}/odm_georef -bundleFile {bundle} -inputCoordFile {coords} '
|
||||
'-inputFile {model} -outputFile {model_geo} '
|
||||
'-inputPointCloudFile {pc} -outputPointCloudFile {pc_geo} {verbose} '
|
||||
'-logFile {log} -georefFileOutputPath {geo_sys}'.format(**kwargs))
|
||||
'-logFile {log} -outputTransformFile {transform_file} -georefFileOutputPath {geo_sys}'.format(**kwargs))
|
||||
else:
|
||||
log.ODM_WARNING('Georeferencing failed. Make sure your '
|
||||
'photos have geotags in the EXIF or you have '
|
||||
|
|
Ładowanie…
Reference in New Issue