From 33acdec0ffd14d10dde50b250cac74970b027773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Wehrl=C3=A9?= Date: Fri, 28 Jun 2024 21:14:24 +0200 Subject: [PATCH 1/5] Modify `exiftool.ExifTooHelper()` for `exiftool.ExifTool()` --- micasense/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micasense/metadata.py b/micasense/metadata.py index 9aa7ffb1..f2344a26 100644 --- a/micasense/metadata.py +++ b/micasense/metadata.py @@ -48,7 +48,7 @@ def __init__(self, filename: str, exiftool_path=None, exiftool_obj=None): self.exiftoolPath = None if not os.path.isfile(filename): raise IOError("Input path is not a file") - with exiftool.ExifToolHelper() as exift: + with exiftool.ExifTool() as exift: self.exif = exift.get_metadata(filename) def get_all(self): From 0c03804ddc9af7ad6859ba7b5d9c8a83a1e45f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Wehrl=C3=A9?= Date: Fri, 28 Jun 2024 21:15:34 +0200 Subject: [PATCH 2/5] Fix `get_item()` No need to index self.exif at 0 --- micasense/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micasense/metadata.py b/micasense/metadata.py index f2344a26..a2b3e6a1 100644 --- a/micasense/metadata.py +++ b/micasense/metadata.py @@ -60,7 +60,7 @@ def get_item(self, item, index=None): val = None try: assert len(self.exif) > 0 - val = self.exif[0][item] + val = self.exif[item] if index is not None: try: if isinstance(val, unicode): From 97e56640bad303f34acf44a0d379cd390a50da20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Wehrl=C3=A9?= Date: Fri, 28 Jun 2024 21:20:56 +0200 Subject: [PATCH 3/5] Update README.md --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78c1f9bd..88beee05 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ datasets. For a user of RedEdge or Altum that wants a turnkey processing solution, this repository probably is not the best place to start. Instead consider one of the MicaSense processing partners who provide turnkey software for processing and -analysis. +analysis.pyexiftool==0.4.13 ### Tutorial Articles @@ -96,7 +96,7 @@ then [create an issue on github](https://github.com/micasense/imageprocessing/is Tests for many library functions are included in the `tests` diretory. Install the `pytest` module through your package manager (e.g. `pip install pytest`) and then tests can be run from the main directory using the command: - +pyexiftool==0.4.13 ```bash pytest ``` @@ -137,3 +137,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +## Notes + +Downgraded `pyexiftool` to `pip install pyexiftool==0.4.13` following [#117](https://github.com/micasense/imageprocessing/issues/177) as `pyexiftool>=0.5.0` doesn't support the `get_metadata()` method anymore. + From 56d11c67120238ef758c69626a011f3dded10ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Wehrl=C3=A9?= Date: Fri, 28 Jun 2024 21:24:43 +0200 Subject: [PATCH 4/5] Document fork modifications --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88beee05..cd95e9fb 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER I OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## Notes +## Fork modifications Downgraded `pyexiftool` to `pip install pyexiftool==0.4.13` following [#117](https://github.com/micasense/imageprocessing/issues/177) as `pyexiftool>=0.5.0` doesn't support the `get_metadata()` method anymore. From 19df1d8372daea5e6c45cde9cec560b9e63f2f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Wehrl=C3=A9?= Date: Sat, 29 Jun 2024 00:02:31 +0200 Subject: [PATCH 5/5] pass `irradiance_list` in `aligned_capture()` --- micasense/imageutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micasense/imageutils.py b/micasense/imageutils.py index 4f163485..ca6948e9 100644 --- a/micasense/imageutils.py +++ b/micasense/imageutils.py @@ -353,14 +353,14 @@ def align_capture(capture, ref_index=None, warp_mode=cv2.MOTION_HOMOGRAPHY, max_ # apply homography to create an aligned stack def aligned_capture(capture, warp_matrices, warp_mode, cropped_dimensions, match_index, img_type='reflectance', - interpolation_mode=cv2.INTER_LANCZOS4): + irradiance_list, interpolation_mode=cv2.INTER_LANCZOS4): width, height = capture.images[match_index].size() im_aligned = np.zeros((height, width, len(warp_matrices)), dtype=np.float32) for i in range(0, len(warp_matrices)): if img_type == 'reflectance': - img = capture.images[i].undistorted_reflectance() + img = capture.images[i].undistorted_reflectance(irradiance_list[i]) else: img = capture.images[i].undistorted_radiance()