diff --git a/README.md b/README.md index 78c1f9bd..cd95e9fb 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. + + +## 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. + 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() diff --git a/micasense/metadata.py b/micasense/metadata.py index 9aa7ffb1..a2b3e6a1 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): @@ -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):