From b7ae59b429dea8d60d3265406e52a143555004ed Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Sun, 10 Jul 2022 12:40:33 -0400 Subject: [PATCH] Update ExifRead, speed camelCase --> snake_case, fix var used before assignment --- opendm/photo.py | 26 +++++++++++++------------- requirements.txt | 2 +- stages/odm_filterpoints.py | 2 ++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/opendm/photo.py b/opendm/photo.py index 3f8d31e2..e93b17b8 100644 --- a/opendm/photo.py +++ b/opendm/photo.py @@ -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 @@ -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 \ diff --git a/requirements.txt b/requirements.txt index c08df405..474059be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/stages/odm_filterpoints.py b/stages/odm_filterpoints.py index 416007ad..47748860 100644 --- a/stages/odm_filterpoints.py +++ b/stages/odm_filterpoints.py @@ -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: