kopia lustrzana https://github.com/OpenDroneMap/ODM
Warn if images have likely invalid GPS position
rodzic
8e86daae9d
commit
a4ef8a9f2b
|
@ -214,7 +214,7 @@ class ODM_Photo:
|
||||||
if 'Image Orientation' in tags:
|
if 'Image Orientation' in tags:
|
||||||
self.orientation = self.int_value(tags['Image Orientation'])
|
self.orientation = self.int_value(tags['Image Orientation'])
|
||||||
except (IndexError, ValueError) as e:
|
except (IndexError, ValueError) as e:
|
||||||
log.ODM_WARNING("Cannot read basic EXIF tags for %s: %s" % (_path_file, str(e)))
|
log.ODM_WARNING("Cannot read basic EXIF tags for %s: %s" % (self.filename, str(e)))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if 'Image Tag 0xC61A' in tags:
|
if 'Image Tag 0xC61A' in tags:
|
||||||
|
@ -256,7 +256,12 @@ class ODM_Photo:
|
||||||
epoch = timezone.localize(datetime.utcfromtimestamp(0))
|
epoch = timezone.localize(datetime.utcfromtimestamp(0))
|
||||||
self.utc_time = (timezone.localize(utc_time) - epoch).total_seconds() * 1000.0
|
self.utc_time = (timezone.localize(utc_time) - epoch).total_seconds() * 1000.0
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.ODM_WARNING("Cannot read extended EXIF tags for %s: %s" % (_path_file, str(e)))
|
log.ODM_WARNING("Cannot read extended EXIF tags for %s: %s" % (self.filename, str(e)))
|
||||||
|
|
||||||
|
# Warn if GPS coordinates are suspiciously wrong
|
||||||
|
if self.latitude is not None and self.latitude == 0 and \
|
||||||
|
self.longitude is not None and self.longitude == 0:
|
||||||
|
log.ODM_WARNING("%s has GPS position (0,0), possibly corrupted" % self.filename)
|
||||||
|
|
||||||
|
|
||||||
# Extract XMP tags
|
# Extract XMP tags
|
||||||
|
@ -381,7 +386,7 @@ class ODM_Photo:
|
||||||
self.roll *= -1
|
self.roll *= -1
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.ODM_WARNING("Cannot read XMP tags for %s: %s" % (_path_file, str(e)))
|
log.ODM_WARNING("Cannot read XMP tags for %s: %s" % (self.filename, str(e)))
|
||||||
|
|
||||||
# self.set_attr_from_xmp_tag('center_wavelength', xtags, [
|
# self.set_attr_from_xmp_tag('center_wavelength', xtags, [
|
||||||
# 'Camera:CentralWavelength'
|
# 'Camera:CentralWavelength'
|
||||||
|
|
Ładowanie…
Reference in New Issue