More robust band name detection, bundle_common_position_constraints option support

pull/1057/head
Piero Toffanin 2020-02-01 19:19:35 +00:00
rodzic 3d383ab265
commit 331ede28a7
2 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -117,6 +117,8 @@ class OSFMContext:
"undistorted_image_format: tif", "undistorted_image_format: tif",
"bundle_outlier_filtering_type: AUTO", "bundle_outlier_filtering_type: AUTO",
"align_orientation_prior: vertical", "align_orientation_prior: vertical",
"triangulation_type: ROBUST",
"bundle_common_position_constraints: %s" % ('no' if reconstruction.multi_camera is None else 'yes'),
] ]
if args.camera_lens != 'auto': if args.camera_lens != 'auto':

Wyświetl plik

@ -8,6 +8,7 @@ from opendm import location
from opendm.gcp import GCPFile from opendm.gcp import GCPFile
from pyproj import CRS from pyproj import CRS
import xmltodict as x2d import xmltodict as x2d
from six import string_types
import log import log
import io import io
@ -82,8 +83,21 @@ class ODM_Photo:
for tags in xmp: for tags in xmp:
if 'Camera:BandName' in tags: if 'Camera:BandName' in tags:
self.band_name = str(tags['Camera:BandName']).replace(" ", "") cbt = tags['Camera:BandName']
band_name = None
if isinstance(cbt, string_types):
band_name = str(tags['Camera:BandName'])
elif isinstance(cbt, dict):
items = cbt.get('rdf:Seq', {}).get('rdf:li', {})
if items:
band_name = " ".join(items)
if band_name is not None:
self.band_name = band_name.replace(" ", "")
else:
log.ODM_WARNING("Camera:BandName tag found in XMP, but we couldn't parse it. Multispectral bands might be improperly classified.")
for cit in camera_index_tags: for cit in camera_index_tags:
if cit in tags: if cit in tags:
self.band_index = int(tags[cit]) self.band_index = int(tags[cit])