kopia lustrzana https://github.com/OpenDroneMap/ODM
Add tag in case user wants to override GCP
rodzic
fc2ccf4ce5
commit
cdf120873c
|
@ -260,6 +260,12 @@ def config():
|
||||||
'be on the following line format: \neasting '
|
'be on the following line format: \neasting '
|
||||||
'northing height pixelrow pixelcol imagename'))
|
'northing height pixelrow pixelcol imagename'))
|
||||||
|
|
||||||
|
parser.add_argument('--use-exif',
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help=('Use this tag if you have a gcp_list.txt but '
|
||||||
|
'want to use the exif geotags instead'))
|
||||||
|
|
||||||
# Depreciated
|
# Depreciated
|
||||||
parser.add_argument('--odm_georeferencing-useGcp',
|
parser.add_argument('--odm_georeferencing-useGcp',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
|
|
@ -67,6 +67,7 @@ class ODMApp(ecto.BlackBox):
|
||||||
keep_unseen_faces=p.args.texturing_keep_unseen_faces),
|
keep_unseen_faces=p.args.texturing_keep_unseen_faces),
|
||||||
'georeferencing': ODMGeoreferencingCell(img_size=p.args.resize_to,
|
'georeferencing': ODMGeoreferencingCell(img_size=p.args.resize_to,
|
||||||
gcp_file=p.args.gcp,
|
gcp_file=p.args.gcp,
|
||||||
|
use_exif=p.args.use_exif,
|
||||||
verbose=p.args.verbose),
|
verbose=p.args.verbose),
|
||||||
'orthophoto': ODMOrthoPhotoCell(resolution=p.args.orthophoto_resolution,
|
'orthophoto': ODMOrthoPhotoCell(resolution=p.args.orthophoto_resolution,
|
||||||
verbose=p.args.verbose)
|
verbose=p.args.verbose)
|
||||||
|
|
|
@ -16,6 +16,7 @@ class ODMGeoreferencingCell(ecto.Cell):
|
||||||
'be on the following line format: \neasting '
|
'be on the following line format: \neasting '
|
||||||
'northing height pixelrow pixelcol imagename', 'gcp_list.txt')
|
'northing height pixelrow pixelcol imagename', 'gcp_list.txt')
|
||||||
params.declare("img_size", 'image size used in calibration', 2400)
|
params.declare("img_size", 'image size used in calibration', 2400)
|
||||||
|
params.declare("use_exif", 'use exif', False)
|
||||||
params.declare("verbose", 'print additional messages to console', False)
|
params.declare("verbose", 'print additional messages to console', False)
|
||||||
|
|
||||||
def declare_io(self, params, inputs, outputs):
|
def declare_io(self, params, inputs, outputs):
|
||||||
|
@ -64,7 +65,7 @@ class ODMGeoreferencingCell(ecto.Cell):
|
||||||
'imgs': tree.dataset_resize,
|
'imgs': tree.dataset_resize,
|
||||||
'imgs_list': tree.opensfm_bundle_list,
|
'imgs_list': tree.opensfm_bundle_list,
|
||||||
'coords': tree.odm_georeferencing_coords,
|
'coords': tree.odm_georeferencing_coords,
|
||||||
'log': tree.odm_georeferencing_utm_log
|
'log': tree.odm_georeferencing_utm_log,
|
||||||
'verbose': verbose
|
'verbose': verbose
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,13 +114,17 @@ class ODMGeoreferencingCell(ecto.Cell):
|
||||||
|
|
||||||
# Check to see if the GCP file exists
|
# Check to see if the GCP file exists
|
||||||
|
|
||||||
if self.params.gcp_file or find('gcp_list.txt', tree.root_path):
|
if not self.params.use_exif and (self.params.gcp_file or find('gcp_list.txt', tree.root_path)):
|
||||||
log.ODM_INFO('Found %s' % gcpfile)
|
log.ODM_INFO('Found %s' % gcpfile)
|
||||||
|
try:
|
||||||
system.run('{bin}/odm_georef -bundleFile {bundle} -imagesPath {imgs} -imagesListPath {imgs_list} '
|
system.run('{bin}/odm_georef -bundleFile {bundle} -imagesPath {imgs} -imagesListPath {imgs_list} '
|
||||||
'-bundleResizedTo {size} -inputFile {model} -outputFile {model_geo} '
|
'-bundleResizedTo {size} -inputFile {model} -outputFile {model_geo} '
|
||||||
'-inputPointCloudFile {pc} -outputPointCloudFile {pc_geo} {verbose} '
|
'-inputPointCloudFile {pc} -outputPointCloudFile {pc_geo} {verbose} '
|
||||||
'-logFile {log} -georefFileOutputPath {geo_sys} -gcpFile {gcp} '
|
'-logFile {log} -georefFileOutputPath {geo_sys} -gcpFile {gcp} '
|
||||||
'-outputCoordFile {coords}'.format(**kwargs))
|
'-outputCoordFile {coords}'.format(**kwargs))
|
||||||
|
except Exception:
|
||||||
|
log.ODM_EXCEPTION('Georeferencing failed. ')
|
||||||
|
return ecto.QUIT
|
||||||
elif io.file_exists(tree.odm_georeferencing_coords):
|
elif io.file_exists(tree.odm_georeferencing_coords):
|
||||||
log.ODM_INFO('Running georeferencing with generated coords file.')
|
log.ODM_INFO('Running georeferencing with generated coords file.')
|
||||||
system.run('{bin}/odm_georef -bundleFile {bundle} -inputCoordFile {coords} '
|
system.run('{bin}/odm_georef -bundleFile {bundle} -inputCoordFile {coords} '
|
||||||
|
|
Ładowanie…
Reference in New Issue