Distance information for Sony SLR cameras

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

Previous topic - Next topic

Phil Harvey

I only have one sample at infinity focus, so it isn't enough to track this down, but I wouldn't expect this information to exist other than with focus position information which I failed to locate.

- 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 for all hard work. Maybe A55 is too low level to get this information?

rsjaffe

Quote from: LKB on November 24, 2011, 07:45:28 PM
THank you for all hard work. Maybe A55 is too low level to get this information?
I have a Sony A850, which is their full-frame camera (though a bit older than the A55). Would it be useful if I sent you EXIF dumps from this camera (in order to get distance info). If so, is there a particular set of distances (and/or type of lens--normal wide tele zoom etc) that would make it easier?

--Rory

Phil Harvey

#33
Hi Rory,

Sure, let's give it a try.  How about this?:

For 2 lenses of different focal lengths, shoot a picture using manual focus at each numbered distance on the focus barrel.  Add the focus distance to each file name, then use the following command and send me the EXIF files (mail them to philharvey66 at gmail.com):

exiftool -tagsfromfile @ -all:all -o %d%f.exif DIR

where DIR is the name of the directory containing the images.

- 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 ($).

mikey2000

I saw that the website notes about maker notes now includes info about A55 local AF area.   I was wondering if you have sample images yet from an a77?

I would also be keen to see focus distance information if it's possible to extract it from a77 exif, even if it is only approximate.

Cheers,
Michael

Phil Harvey

Hi Michael,

Thanks for the offer.

I would be willing to bet that I wouldn't be able to decode focas distance information from the A77.  However, focus position should definitely be possible.

If you take a picture using each of the AF points and send me the EXIF files (use the command in my previous post), then I'll decode this information and add it to the next release.

- 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 ($).

mikey2000

No problem!  I've just sent you an email with the exif from various photos.

This is very much appreciated!

Cheers,
Michael

Phil Harvey

Hi Michael,

Thanks for the samples.

As I was analyzing them, I had a strong feeling of déjà vu.  It turns out I did this before, back in November.

Unfortunately, I get the same result with the samples you sent.  I can't find the AF information anywhere.

I can't believe that the information just isn't there.  Perhaps it is encrypted somehow, and maybe with the samples I am accumulating I'll be able to figure this out sometime.

- 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 ($).

mikey2000

Sony strikes again!   Thanks for looking though.  If you need more a77 samples for other purposes, just ask!

Cheers
Michael

Phil Harvey

#39
I just got the A850 samples for Rory, and found a byte in tag 0x0020 which gives the focus position with a roughly linear relationship to distance.  However, it varies with the focal length, so some further analysis is necessary to see if it can be converted to a focus distance:



Edit: Rory sent me an email indicating that the one lens was 135mm, not 35mm.  I don't understand this, because the EXIF says 35mm, but if true the formula changes to  distance = val * FocalLength / 1000, which is nicer, makes more sense, and fits the data better.

Edit2: Changed the above plot to use the new formula, and added data for the 400mm focal length. (Thanks Rory!)

Note that the right side of the plot is a value of 128, which is the maximum value for this byte, so it represents infinity focus for each lens.
...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 ($).

mikey2000

Would you like some a77 samples with a variety of focal length/focus distances?

Phil Harvey

#41
Hi Mikey,

Thanks for the offer, but I already have A77 samples like this and I haven't been able to determine where/if this information is stored in A77 images.  The A77 doesn't have the 0x0020 tag, which is where this is found in A100 and A850 images.

- Phil

Edit: I just checked since I am home now with my full set of samples, and it turns out that I don't have focus distance samples for the A77 (I was thinking about the A55).  So if you want to send me some samples, feel free, although we shouldn't get our hopes up.  You can follow the instructions in this thread and send me the EXIF files
...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

So do I understand correctly that distance extraction seems to be only possible with A100 & A900 (and possibly A850) on this stage?

Phil Harvey

#43
Looking back through my records, here are the models I have checked so far, and whether or not I could find FocusDistance information in their images:

Models where I have a full set of focus-distance test shots:

A55 - no
A77 - no
A100 - yes
A560 - no
A580 - no
A850 - yes
NEX-3 - no
NEX-5 - no
NEX-C3 - no

Models where I have a couple of shots, so I'm not sure about these:

A33 - no
A35 - no
NEX-7 - no

- 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 ($).

JosR

Some updates to this topic, based on recent findings:

1) The existing FocusPosition (Tag 0x0020 FocusInfo, offset 0x09bb), which was validated for the DSLR-A850, is most probably valid
for ALL the earlier DSLR models (except DSLR-A100) as all these have similar Makernotes,
i.e. valid for the DSLR-A200/A300/A350/A230/A290/A330/A380/A390/A700/A850/A900.

2) For the DSLR-A580, I recently found FocusPosition info, also in Tag 0x0020 (MoreInfo - MoreSettings).
However, in this case, the values range from appr. 80 to 255, with 255 indicating Infinity.
For converting this FocusPosition into FocusDistance, I found that the formula mentioned in minolta.pm at WBInfoA100 - 0x49bb
provided the best match for my series of A580 test shots with different focal lengths and at different distances:
    (1.5*2**($val/16-5) + 1) * FocalLength/1000
This FocusPosition info is present in MoreSettings
at offset 0x0029 for the DSLR-A450/A500/A550
at offset 0x002b for the NEX-3/5/5C
at offset 0x002f for the DSLR-A560/A580, SLT-A33/A35/A55V and NEX-C3/VG10E

3) Searching for similar FocusPosition tags for all the newer SLT, NEX, ILCE and ILCA models, I found the following:
Tag9402 offset 0x002c and/or 0x002d: for all newer NEX- and all ILCE-models
Tag9404b offset 0x0020: for newer SLT- and ILCA-models, EXCEPT SLT-A65V and A77V
(A77V/A65V were the first SLT models with the new 94xx Makernote tags - possibly FocusPosition for these models was left out 'accidentally' ...)

For info, attached is a plot of my own tests with the A580, and including the A580 flash distance images from Imaging-resource:
- a reasonable match, except only for 16 mm where the formula appears to give too high distance values ...

Also, for many sample images that I checked, the above formula gave mostly 'acceptable' distance indications, as far as I could deduce from the image and the FocalLength.
But for validation, more tests with other cameras would be very welcome...