Merge pull request #1495 from pierotofy/bugfixes

Bug Fixes
pull/1496/head
Piero Toffanin 2022-07-10 12:48:51 -04:00 zatwierdzone przez GitHub
commit d21c5baf64
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 25 dodań i 20 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ def compute_boundary_from_shots(reconstruction_json, buffer=0, reconstruction_of
for shot_image in reconstruction['shots']:
shot = reconstruction['shots'][shot_image]
if shot['gps_dop'] < 999999:
if shot.get('gps_dop', 999999) < 999999:
camera = reconstruction['cameras'][shot['camera']]
p = ogr.Geometry(ogr.wkbPoint)

Wyświetl plik

@ -333,7 +333,7 @@ def median_smoothing(geotiff_path, output_path, smoothing_iterations=1):
dtype = img.dtypes[0]
arr = img.read()[0]
nodata_locs = numpy.where(arr == nodata)
nodata_locs = arr == nodata
# Median filter (careful, changing the value 5 might require tweaking)
# the lines below. There's another numpy function that takes care of

Wyświetl plik

@ -142,9 +142,9 @@ class ODM_Photo:
self.dls_roll = None
# Aircraft speed
self.speedX = None
self.speedY = None
self.speedZ = None
self.speed_x = None
self.speed_y = None
self.speed_z = None
# self.center_wavelength = None
# self.bandwidth = None
@ -217,7 +217,7 @@ class ODM_Photo:
self.camera_model = "unknown"
if 'GPS GPSAltitude' in tags:
self.altitude = self.float_value(tags['GPS GPSAltitude'])
if 'GPS GPSAltitudeRef' in tags and self.int_value(tags['GPS GPSAltitudeRef']) > 0:
if 'GPS GPSAltitudeRef' in tags and self.int_value(tags['GPS GPSAltitudeRef']) is not None and self.int_value(tags['GPS GPSAltitudeRef']) > 0:
self.altitude *= -1
if 'GPS GPSLatitude' in tags and 'GPS GPSLatitudeRef' in tags:
self.latitude = self.dms_to_decimal(tags['GPS GPSLatitude'], tags['GPS GPSLatitudeRef'])
@ -277,9 +277,9 @@ class ODM_Photo:
if 'MakerNote SpeedX' in tags and \
'MakerNote SpeedY' in tags and \
'MakerNote SpeedZ' in tags:
self.speedX = self.float_value(tags['MakerNote SpeedX'])
self.speedY = self.float_value(tags['MakerNote SpeedY'])
self.speedZ = self.float_value(tags['MakerNote SpeedZ'])
self.speed_x = self.float_value(tags['MakerNote SpeedX'])
self.speed_y = self.float_value(tags['MakerNote SpeedY'])
self.speed_z = self.float_value(tags['MakerNote SpeedZ'])
except Exception as e:
log.ODM_WARNING("Cannot read extended EXIF tags for %s: %s" % (self.filename, str(e)))
@ -386,13 +386,13 @@ class ODM_Photo:
if '@drone-dji:FlightXSpeed' in xtags and \
'@drone-dji:FlightYSpeed' in xtags and \
'@drone-dji:FlightZSpeed' in xtags:
self.set_attr_from_xmp_tag('speedX', xtags, [
self.set_attr_from_xmp_tag('speed_x', xtags, [
'@drone-dji:FlightXSpeed'
], float)
self.set_attr_from_xmp_tag('speedY', xtags, [
self.set_attr_from_xmp_tag('speed_y', xtags, [
'@drone-dji:FlightYSpeed',
], float)
self.set_attr_from_xmp_tag('speedZ', xtags, [
self.set_attr_from_xmp_tag('speed_z', xtags, [
'@drone-dji:FlightZSpeed',
], float)
@ -776,7 +776,7 @@ class ODM_Photo:
# Speed is not useful without GPS
if self.has_speed() and has_gps:
d['speed'] = [self.speedY, self.speedX, self.speedZ]
d['speed'] = [self.speed_y, self.speed_x, self.speed_z]
if rolling_shutter:
d['rolling_shutter'] = get_rolling_shutter_readout(self.camera_make, self.camera_model, rolling_shutter_readout)
@ -794,9 +794,9 @@ class ODM_Photo:
self.kappa is not None
def has_speed(self):
return self.speedX is not None and \
self.speedY is not None and \
self.speedZ is not None
return self.speed_x is not None and \
self.speed_y is not None and \
self.speed_z is not None
def has_geo(self):
return self.latitude is not None and \

Wyświetl plik

@ -3,7 +3,7 @@ attrs==20.3.0
beautifulsoup4==4.9.3
cloudpickle==1.6.0
edt==2.0.2
ODMExifRead==3.0.3
ODMExifRead==3.0.4
Fiona==1.8.17 ; sys_platform == 'linux' or sys_platform == 'darwin'
https://github.com/OpenDroneMap/windows-deps/raw/main/Fiona-1.8.19-cp38-cp38-win_amd64.whl ; sys_platform == 'win32'
joblib==0.17.0

Wyświetl plik

@ -16,6 +16,8 @@ class ODMFilterPoints(types.ODM_Stage):
if not os.path.exists(tree.odm_filterpoints): system.mkdir_p(tree.odm_filterpoints)
inputPointCloud = ""
# check if reconstruction was done before
if not io.file_exists(tree.filtered_point_cloud) or self.rerun():
if args.fast_orthophoto:
@ -28,9 +30,12 @@ class ODMFilterPoints(types.ODM_Stage):
if reconstruction.is_georeferenced():
if not 'boundary' in outputs:
avg_gsd = gsd.opensfm_reconstruction_average_gsd(tree.opensfm_reconstruction)
outputs['boundary'] = compute_boundary_from_shots(tree.opensfm_reconstruction, avg_gsd * 20, reconstruction.get_proj_offset()) # 20 is arbitrary
if outputs['boundary'] is None:
log.ODM_WARNING("Cannot compute boundary from camera shots")
if avg_gsd is not None:
outputs['boundary'] = compute_boundary_from_shots(tree.opensfm_reconstruction, avg_gsd * 20, reconstruction.get_proj_offset()) # 20 is arbitrary
if outputs['boundary'] is None:
log.ODM_WANING("Cannot compute boundary from camera shots")
else:
log.ODM_WARNING("Cannot compute boundary (GSD cannot be estimated)")
else:
log.ODM_WARNING("--auto-boundary set but so is --boundary, will use --boundary")
else: