OpenImageIO icon indicating copy to clipboard operation
OpenImageIO copied to clipboard

MakerNotes exif metadata for Sony

Open fabiencastan opened this issue 7 years ago • 11 comments

Problem

The support for metadata has been greatly improved in https://github.com/OpenImageIO/oiio/issues/1739. Unfortunately Exif contains many custom cases and it would be great to support more MakerNotes as they contain a large part of the image information.

Here is an example of Sony image: dsc01940

In our use case (photogrammetry), we need to retrieve the BodySerialNumber and the LensSerialNumber which are unfortunately in the MakerNotes.

fabiencastan avatar Jan 21 '19 23:01 fabiencastan

I'll see what I can do!

lgritz avatar Jan 22 '19 00:01 lgritz

Thanks a lot!

fabiencastan avatar Jan 22 '19 09:01 fabiencastan

Here's what I'm working from as my reference: https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html

It's a lot to support all at once, may be better to do it in stages, so if you tell me which specific tags are of interest, I'll prioritize those in terms of getting an initial PR.

lgritz avatar Jan 25 '19 23:01 lgritz

Wrong link. I meant this: https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Sony.html

lgritz avatar Jan 25 '19 23:01 lgritz

Hi, @fabiencastan , I've been sitting on a patch for this for a few weeks, but before submitting it I was hoping you could maybe tell me exactly which metadata you need so I'm sure it's among what I'm retrieving successfully?

lgritz avatar Feb 15 '19 18:02 lgritz

Hi Larry, I'm sorry, I missed you previous messages!! The full list of metadata we are looking for are:

  • Exif:BodySerialNumber
  • Exif:LensSerialNumber
  • Exif:FocalLength
  • Exif:FocalLengthIn35mmFilm
  • Make
  • Model
  • Orientation
  • Exif:PixelXDimension
  • Exif:PixelYDimension

As mentioned in my initial message, the problem is that unfortunately the *SerialNumber ones are in the MakerNotes and that's a key issue for photogrammetry to be able recognize if images were taken from the same device or from another one.

Thanks a lot for working on this topic, that's really helpful!

fabiencastan avatar Feb 16 '19 20:02 fabiencastan

You know, I'm not sure that these weren't there all along. We already look for all of these, including the body and lens serial numbers.

The BodySerialNumber or LensSerialNumber do seem to be Exif fields, not MakerNote fields. They are described in the Exif 2.3 specification, and are not anywhere to be found on this list of Sony makernote fields (which may not be authoritative): https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Sony.html

The image that you reference as an example -- I tested with Apple Preview.app, ImageMagick "identify --verbose", and exiftool, and all fail to list either BodySerialNumber or LensSerialNumber for this image, though the rest of the Exif fields there and match what OIIO lists.

Can you double check on your end, and provide a link to a Sony camera image that you are sure has these fields in them? I think that everything may already be working for files that have this data. (And I do still have a patch ready to send that expands the makernote info that OIIO understands, but like I said, the lens and body serial numbers do not appear to be among them.)

lgritz avatar Mar 04 '19 20:03 lgritz

The Exif does contain a LensType and LensModel. Not sure if this is different data than the lens serial number or not. And does "Model" not tell you everything you would get from the body serial number?

lgritz avatar Mar 04 '19 20:03 lgritz

Hi Larry,

Thank you for the investigation. We need the serial number as it provides a unique ID for the device which enables to make the difference between 2 cameras with the same Model. If I use 2 Sony ILCE-7SM2 devices to make the acquisition (which is a common use case), I need to detect them to avoid using the same internal camera parameters for both in the Structure-from-Motion optimization. It's even worse in the case of a studio booth with hundred of cameras with exactly the same Model and Lens. The serial number is the only way to see that it's not the same device.

With the latest exifTool, I can see the serial number (from the Maker Notes):

(exifTool-11.31): ~ > exifTool -a /path/to/footage/2019_01_20_buddha/DSC01728.JPG | grep -i serial
Internal Serial Number          : dcfe0000ac0a

But I don't have access to this information from OpenImageIO:

(oiio-1.8.15): ~ > oiiotool --info -v -i /path/to/footage/2019_01_20_buddha/DSC01728.JPG
Reading /path/to/footage/2019_01_20_buddha/DSC01728.JPG
/path/to/footage/2019_01_20_buddha/DSC01728.JPG : 4240 x 2832, 3 channel, uint8 jpeg
   channel list: R, G, B
   oiio:ColorSpace: "sRGB"
   jpeg:subsampling: "4:2:2"
   ImageDescription: "                               "
   Make: "SONY"
   Model: "ILCE-7SM2"
   Orientation: 1 (normal)
   XResolution: 350
   YResolution: 350
   ResolutionUnit: "none"
   Software: "ILCE-7SM2 v2.00"
   DateTime: "2019:01:20 13:56:44"
   Exif:YCbCrPositioning: 2
   ExposureTime: 0.1
   FNumber: 22
   Exif:ExposureProgram: 1 (manual)
   Exif:PhotographicSensitivity: 8000
   Exif:SensitivityType: 2
   Exif:RecommendedExposureIndex: 8000
   Exif:DateTimeOriginal: "2019:01:20 13:56:44"
   Exif:DateTimeDigitized: "2019:01:20 13:56:44"
   Exif:CompressedBitsPerPixel: 2
   Exif:BrightnessValue: 2.68906
   Exif:ExposureBiasValue: 0
   Exif:MaxApertureValue: 2.96875 (f/2.79796)
   Exif:MeteringMode: 5 (pattern)
   Exif:LightSource: 0 (unknown)
   Exif:Flash: 16 (no flash, flash supression)
   Exif:FocalLength: 16 (16 mm)
   Exif:ColorSpace: 1
   Exif:PixelXDimension: 4240
   Exif:PixelYDimension: 2832
   Exif:CustomRendered: 0 (no)
   Exif:ExposureMode: 1 (manual)
   Exif:WhiteBalance: 1 (manual)
   Exif:DigitalZoomRatio: 1
   Exif:FocalLengthIn35mmFilm: 16
   Exif:SceneCaptureType: 0 (standard)
   Exif:Contrast: 0 (normal)
   Exif:Saturation: 0 (normal)
   Exif:Sharpness: 0 (normal)
   Exif:LensSpecification: 16, 35, 2.8, 2.8
   Exif:LensModel: "16-35mm F2.8 G SSM II"

Thanks!

fabiencastan avatar Mar 11 '19 12:03 fabiencastan

Hi, Let me know if you need more information or if I can help in one way or another to see this issue solved.

fabiencastan avatar Apr 08 '19 21:04 fabiencastan

Hi @lgritz , Can I start testing the patch you have started? It would be really great to have this feature for the next release of Meshroom. Best,

fabiencastan avatar May 12 '19 08:05 fabiencastan