diff --git a/opendm/osfm.py b/opendm/osfm.py index 6690a7c2..695a8896 100644 --- a/opendm/osfm.py +++ b/opendm/osfm.py @@ -117,6 +117,8 @@ class OSFMContext: "undistorted_image_format: tif", "bundle_outlier_filtering_type: AUTO", "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': diff --git a/opendm/types.py b/opendm/types.py index 652a4477..3dc2451f 100644 --- a/opendm/types.py +++ b/opendm/types.py @@ -8,6 +8,7 @@ from opendm import location from opendm.gcp import GCPFile from pyproj import CRS import xmltodict as x2d +from six import string_types import log import io @@ -82,8 +83,21 @@ class ODM_Photo: for tags in xmp: 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: if cit in tags: self.band_index = int(tags[cit])