Forum

Author Topic: TIFF import does not read the camera Make and Model EXIF tags  (Read 3348 times)

jmsuomal

  • Newbie
  • *
  • Posts: 17
    • View Profile
I am not sure if this is a bug or "feature", but its troublesome anyway.

When importing Python-generated JPEG images, Metashape loads the camera Make and Model tags from the EXIF tag. This allows metashape to automatically separate the images taken using different cameras to different camera calibrations. However this feature does not seem to work when loading Python-generated (16-bit) TIFF images and doing the separation manually is a frustrating process. The GPS coordinates and focal length are still loaded from TIFF files, so some reading of EXIF data is definitely still happening with TIFF files, but all relevant fields are not processed.

How I found the problem:
I am using a multicamera setup, with processing chain where calibrated images are exported using Python as 16-bit TIFF files:

Code: [Select]
TIFF.imsave(OutputFile, (10*ImgBitmap).astype(np.uint16), planarconfig='contig')

As the Python TIFF module does not seem to properly support writing EXIF tags, those are then written with Phil Harvey's exiftool.exe using commands similar to this:

exiftool.exe -overwrite_original -XMP:Make="MyOrganizationName" -XMP:Model="RGB1" -XMP:ExposureTime=0.003946 -XMP:FocalLength=16.0 -XMP:FocalPlaneResolutionUnit=4 -XMP:FocalPlaneXResolution=289.855 -XMP:FocalPlaneYResolution=289.855 "D:\Test\Img_00000.tiff"

E.g. windows image file properties, show that files have these tags written correctly, but Metashape cannot read them from TIFF files. Running the very same exiftool command on a jpeg file, results in a JPEG file that can be loaded to Metashape with the correct Make and Model metadata. This makes me believe that the problem is that the Metashape TIFF import is not reading the EXIF data from TIFFs the same way as the JPEG import does.

While waiting for update, is there a workaround? Which TIFF file EXIF tags are read by the Metashape that could be used to differentiate the different cameras? E.g. the XMP:SerialNumber ("BodySerialNumber") tag does not seem to work either...

The 16-bit example TIFFs files are rather large, so I will not attach them to this post unless especially needed for troubleshooting.
« Last Edit: April 01, 2020, 04:07:38 PM by jmsuomal »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: TIFF import does not read the camera Make and Model EXIF tags
« Reply #1 on: April 01, 2020, 04:28:35 PM »
Hello jmsuomal,

Can you share any sample TIFF with the tags that you have applied?
Best regards,
Alexey Pasumansky,
Agisoft LLC

jmsuomal

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: TIFF import does not read the camera Make and Model EXIF tags
« Reply #2 on: April 02, 2020, 11:32:35 AM »
Dear Alexey,

Here is a download link to a zip file with a pair of TIFFs.

https://1drv.ms/u/s!Ak8PmH82SbCPiYhdW2Rn9p8IzLSaGQ?e=dmqZEk

They are acquired using different cameras ("RGB1" and "RGB2") and should be assigned to different camera calibrations.

edit: Those images happened to be ones without GPS position data. So when those give zero as GPS Lat Lon it is not a problem with Metashape. The GPS coordinate import from these files works fine.
« Last Edit: April 02, 2020, 11:36:14 AM by jmsuomal »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: TIFF import does not read the camera Make and Model EXIF tags
« Reply #3 on: April 03, 2020, 12:42:31 AM »
Hello jmsuomal,

I think that the problem might be that you are writing XMP tags and are not populating corresponding EXIF or TIFF tags, like Make, Model for TiffTag and FocalLength, FocalPlaneXResolution, FocalPlaneYResolution, FocalPlaneResolutionUnit for ExifTag.
Best regards,
Alexey Pasumansky,
Agisoft LLC

jmsuomal

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: TIFF import does not read the camera Make and Model EXIF tags
« Reply #4 on: April 03, 2020, 10:18:07 AM »
Dear Alexey,

That solved it! I simply replaced in the exiftool command the "-XMP:TagName=" with "-TagName=" and it now works perfectly.

Peculiarly, the XMP tags worked perfectly well with the JPEGs and the even the TIFFs were able to load other fields such as GPS location and pixel size XMP fields.

Anyway, that solved it for me. Thank you.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: TIFF import does not read the camera Make and Model EXIF tags
« Reply #5 on: April 03, 2020, 05:43:30 PM »
Hello jmsuomal,

Sometime the information is duplicated in XMP and EXIF tags, we'll check, if it is possible to read the required information from XMP only, if the corresponding EXIF tags are missing.
Best regards,
Alexey Pasumansky,
Agisoft LLC