ODM icon indicating copy to clipboard operation
ODM copied to clipboard

[edgarriba-cmake] Resizing, Exiftags differ for different cameras

Open Fi156 opened this issue 10 years ago • 4 comments

[DEBUG] Resizing dataset to: /media/simon/dataSSD250gb/Merklingsen1Entzerrt/Jpg90Pics/images_resize
Traceback (most recent call last):
  File "run.py", line 34, in <module>
    plasm.execute(niter=1)
  File "/media/simon/dataSSD250gb/OpenDroneMap/scripts/resize.py", line 68, in process
    new_meta['Exif.Photo.PixelXDimension'].value = img_r.shape[0]
  File "/usr/lib/python2.7/dist-packages/pyexiv2/metadata.py", line 209, in __getitem__
    return getattr(self, '_get_%s_tag' % family)(key)
  File "/usr/lib/python2.7/dist-packages/pyexiv2/metadata.py", line 169, in _get_exif_tag
    _tag = self._image._get

The error happens here: https://github.com/OpenDroneMap/OpenDroneMap/blob/edgarriba-cmake/scripts/resize.py#L68 Exif.Photo.PixelXDimension is not a valid Exiftag for Olympus cameras.

I would have suggested the tag Image Size instead but this can not be read by pyexiv2. However exiftool prints this tag for the testdataset as well as for the Olympus data.

Olympus offers the tag Exif Image Width and Exif Image Height but again this tag is present only when using exiftools, because most tags are named like Exif.OlympusFi.0x120a when fetching the tags with pyexiv2.

I see the following solutions:

  • Testing gexiv2, because according to http://tilloy.net/dev/pyexiv2/ pyexiv2 its already deprecated. (And hoping that we can solve the issue that way.)
  • Making a database for each manufacture/model for the correct tags
  • Thinking of other possibilities excluding exiftags.

Fi156 avatar Feb 23 '16 12:02 Fi156

Is it only Olympus cameras that don't use Exif standards, or are other cameras going to be a problem too?

dakotabenjamin avatar Feb 23 '16 13:02 dakotabenjamin

I think gexiv2 is probably the way to go in this case.

dakotabenjamin avatar Feb 23 '16 13:02 dakotabenjamin

Seems to be an error with my preprocessing pipeline. The RAW Olympus images are featuring the necessary tags too as well as out of cam jpgs.

Fi156 avatar Feb 23 '16 13:02 Fi156

Ok! While I still think we should update to modern software, I am glad it is not critical to fix now.

dakotabenjamin avatar Feb 23 '16 13:02 dakotabenjamin