Distance information for Sony SLR cameras

Started by LKB, October 31, 2011, 07:15:27 AM

Previous topic - Next topic

LKB

Hi,
I started playing with my pic EXIF data - I needed to sort pics based on flash/no flash info.
But, once you start you can't stop,so I am now looking to extract focus distance information and hopefully on which sensor the focus was taken. Does anybody know which exif information are responsible for that?
I have looked at Canon data and was able to locate distance information, but coudnt find the same in the Sony EXIF data

Phil Harvey

In general, cameras do not store accurate focus distance information.  The distance stored by Canon cameras is very rough and not very useful.  Some Nikon cameras store more accurate focus distance, but I haven't seen this information from Sony cameras.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

I see,
Driling more about subject - what about MF/AF information?

And if AF, information which sensor the focus was taken? I saw that Canon is displaying this information...

Phil Harvey

The focus mode is probably already decoded by ExifTool.  The AF point information is most certainly stored in the images somewhere, and the LocalAFAreaPoint information is already decoded for some Sony cameras.  If this information isn't decoded for your camera then it is possible to add this feature to ExifTool if you are willing to take some test pictures.  It would help if I knew what model we are talking about.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

Apologies, should have mentioned it from the start
Camera: Sony A55
Lenses: mix of D and non-D lenses all Sony or Minolta

Phil Harvey

Unfortunately the CameraSettings information hasn't yet been decoded for the A55, and this is where most of the focus information will be stored.  It will take some work to decode this information.  Let me know if you are willing to help by taking a series of test pictures.  It should only take about 20 pictures or so to decode the AF information, but a few hundred pictures to decode the rest of the CameraSettings information that has been decoded for other models.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB


Phil Harvey

Great.  If you could take pictures with these settings, keeping careful track of the picture numbers so we don't get confused:

1-4) FocusMode: 1) Manual, 2) AF-S, 3) AF-C, 4) AF-A
5-7) AFAreaMode: 5) Wide, 6) Local, 7) Spot
8-) LocalAfAreaPoint: with the camera on Local AF mode, take a picture with each different AF area

This should cover the basic AF information.

Once you have done this, send me the EXIF from the images (email to philharvey66 at gmail.com).  Extract the EXIF with:

exiftool -o %d%f.exif DIR

where DIR is the name of the directory containing the test images.  Then zip up all of the .exif files and send them to me and I'll analyze them.

Thanks for doing this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

Phil,
Since I'm a poor win user need to use exiftool.exe -o %%d%%f.exif -ext .ARW .
Data has been send to your email, i hope my notes are sounds and I did not messed up the order

Phil Harvey

#9
Thanks.  I got the samples and have responded by email.  I have been able to decode all of the AF information from these.

You only need to double the '%' characters if you are running from a BAT file in Windows.  This shouldn't be necessary when run directly from the Windows command line.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

Phil,
The results looks great.


Cheers for %  clarification, I usually run batches...

Phil Harvey

Great.

If there are any more camera settings that you (or anyone else) wants decoded, I encourage you to send me some sample images and I will see what I can do to add this ability.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

Thank you. When is the update rolling out?

Phil Harvey

At this point it looks like it should be early next week.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

milchtaich

The Sony A100 stores approximate distance information at two locations within the Minolta 0x0020 tag, which are not perfectly correlated.

  • The first location is byte 0x49BB. A decimal value of x indicates a distance of approximately 2^((x-126)/16) meters. The maximum value of 2^((255-126)/16) = 267m should be interpreted as Infinity. The accuracy and consistency of the measurement are by no means great, particularly with non-Sony/Minolta lenses.
  • Incidentally, with the same formula, byte 0x49C6 gives the approximate focal length. The Exif FocalLength tag seems to be based on it. Which may explain why, for some lenses, certain focal lengths never appear in the Exif tag.
  • The other information distance location is the 0x003A-3B pair of bytes. The formula here is more complicated, and it incorporates also the focal length. Anyway, infinity is 3920 (0x0F50).
I don't have any information about other, newer Sony cameras, which do not use the Minolta tags. Nevertheless, I hope the above will be of some use.

Igal Milchtaich