PDA

View Full Version : Focal Distance in EXIF Data



Jon Saperia
11-15-2010, 05:56 PM
I was not sure if this was the correct forum. If the discussion needs to be moved, please let me know.

I would find it very helpful in my own work and in looking at others if I knew the distance the photographer was from the subject when the shot was taken. I know there are some inferences we can make based on focal length, sensor size, etc. But I would just like a value. The most complete tool I know of is exifTool and I use it regularly. It will output 287 different items from a Nikon NEF file. I can not find distance anywhere. Does anyone know how I can find this out?

It just seems like distance is a kind of obvious thing to want to know about.

Thanks
/jon

Mike Tracy
11-15-2010, 08:48 PM
I am not familiar with exiftool but breezebrowser displays distance to subject.

http://www.breezesys.com/BreezeBrowser/index.htm

Desmond Chan
11-15-2010, 08:56 PM
I think Nikon's EXIF has the subject distance data in it. How accurate it is? I don't know. Photoshop Bridge shows it. You can find it using "file info" in Photoshop and look under the "Advanced" tab -> exif.

Another thing is if the poster attached the EXIF to the image posted. Some do, some don't of course.

Jon Saperia
11-15-2010, 09:27 PM
I think Nikon's EXIF has the subject distance data in it. How accurate it is? I don't know. Photoshop Bridge shows it. You can find it using "file info" in Photoshop and look under the "Advanced" tab -> exif.

Another thing is if the poster attached the EXIF to the image posted. Some do, some don't of course.

Thanks. I did look using bridge as you suggested. The only thing I found was: exif:SubjectDistanceRand: 0
Not really helpful it looks like it is a just a default value that is placed in the file. I opened the sample file I am working with and made a couple edits to cause it to create the .xmp sidecar file. Here is the XML section:


<exif:SubjectDistanceRange>0</exif:SubjectDistanceRange>


This leads me to think that either none of the tools can get at it or Nikon does not support it. It must because there are attributes that show hyper focal distance and other distance related information.

Have I missed something?
Thanks for the help.
/jon

Desmond Chan
11-15-2010, 09:52 PM
Thanks. I did look using bridge as you suggested. The only thing I found was: exif:SubjectDistanceRand: 0
Not really helpful it looks like it is a just a default value that is placed in the file.

Have you tried in Bridge, "Camera Data" (EXIF) -> "subject distance"? For example, the subject distance of one of my NEF files shows 1.7m. It shows other distances for other images. So the subject distance data is there. I've used the same way to see the subject distance of other people's image files, too.

One thing I can think of is your camera settings somewhere are different than mine and so it results in your EXIF not showing the subject distance. As for what settings, unfortunately I don't know. But I don't tend to play around with my camera settings a lot (as long as I know where to set aperture, shutter speed and ISO I'm fine).

Geoff Warnock
11-16-2010, 04:51 AM
You may not get a value for subject distance if you're using an off-brand lens.

I can get subject distance (I presume it's calculated from where the lens has to focus) using my Nikkor lenses on my Nikon bodies, but when I use my Sigma 120-400 I lose the subject distance value in the EXIF.

Jon Saperia
11-16-2010, 07:20 AM
Thanks Geoff - I am using a D700 and all the lenses that I am working with are Nikkor lenses as well as Teleconverters.

Can you tell me where you see the subject distance please?

/jon

Geoff Warnock
11-16-2010, 07:43 AM
Hi Jon,

Strangely, I posted the above from memory of trying to find subject distance in exif after seeing it here. I remember finding it for the Nikkor situation as I say, but am now not able to find the information. Frankly it's making me wonder whether I dreamed it!

In Windows 7, right-clicking my images, choosing the details tab, there is a section for subject distance. Exif in Flickr also has subject distance. Unfortunately I just can't find an image which has a number there at the moment...

If I find it I'll post back.

Jon Saperia
11-16-2010, 07:51 AM
When you see the Exif in Flickr, do you see a real value or something like I posted yesterday "0". The only way Flickr would have the data is if it were attached to the file when it was sent. As I noted yesterday, when I edited a NEF file and saved changes, the resulting sidecar file had a place for the value, but "0" was inserted.

What is also interesting is that I cannot find it in NX2 either which is what I use most of the time.

/jon

Geoff Warnock
11-16-2010, 08:02 AM
for pics that show other exif correctly in Flickr, I have 'unknown' for the subj distance. I wish I could remember exactly where I saw it.

I use View NX2, and agree that subject distance is nowhere to be found.

Stu Bowie
11-16-2010, 11:47 AM
You can find the distance in bridge, but I see it depends on which CS you have processed the image. At present, I am using CS5, and all the images I have processed in CS5 shows me the focussing distance in the metadata. When I scroll through my images and pick an image that I know was processed in CS4 or CS3, it doesnt show up. For whats it worth, I use canon with a canon lens.

Jon Saperia
11-16-2010, 11:57 AM
Thanks. I think this may be more a difference of Camera's rather than the processing software, though I could be wrong. Perhaps Nikon just hides it somewhere others can not get at it and the NX2 product just does not display it (in fact it does not display much metadata).

David Gancarz
11-16-2010, 01:20 PM
Jon: exifTool reports it as Focus Distance. See http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html (http://www.sno.phy.queensu.ca/%7Ephil/exiftool/TagNames/Nikon.html) and search for Focus Distance. They remark "(this focus distance is approximate, and not very accurate for some lenses)".

Jon Saperia
11-16-2010, 02:06 PM
David,

Thanks so much. I have no idea why I did not search for this string before. It is present in each of the NEFs I have saved across a variety of lenses. I appreciate that it may not be super accurate, looks to be a bit longer in general than I would have thought, but it is helpful. Many of my shoots seem to be in the 50 - 80 meter range which even with a 600mm and TCs of various sizes explains why so many of my pictures require so much magnification when editing which results in poorer quality work. I have know this for a while. I just have to work harder at getting closer.

I think this is an important piece of information that we should share when posting. I plan on doing it from now on - it will help me be conscious of the issue.

Thanks again -

David Gancarz
11-16-2010, 03:51 PM
I think this is an important piece of information that we should share when posting. I plan on doing it from now on - it will help me be conscious of the issue.


That's a very good idea -- focus distance would be an instructive piece of metadata to include. I don't shoot with Canon but I do see a FocusDistanceUpper and Lower in their Canon ShotInfo Tags. These are, presumably, hyperfocal distances for the as-shot focus setting(??).

... and it bears repeating: Hats off to Phil Harvey (http://www.sno.phy.queensu.ca/%7Ephil/exiftool/) for keeping his excellent exifTool project alive and current.

Jon Saperia
11-16-2010, 04:27 PM
Agreed, exifTool is the first thing I grab when I want to find details of a shot.


FYI, I have seen Upper and Lower in some of my Nikon NEF files - but I can not put my hand on it now. There is definitely a separate value for hyperfocal distance, e.g.,

Hyperfocal Distance : 4293.97 m

Not really sure how helpful this is, but it is interesting and for what I do, mostly a large number.

It is nice to know that there are others out there that use this stuff. It is the best tool for OS X if you do not mind getting your hands dirty :-)

Jeff Dyck
11-16-2010, 05:37 PM
Jon: exifTool reports it as Focus Distance. See http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html (http://www.sno.phy.queensu.ca/%7Ephil/exiftool/TagNames/Nikon.html) and search for Focus Distance. They remark "(this focus distance is approximate, and not very accurate for some lenses)".

I would agree on the inaccuracy comment. I shoot Canon myself and I have on several occasions noticed that the focus distance reported in the EXIF data seems "right out to lunch". I have notably observed problems with the reported distance when using a TC or extension tube.

Jon Saperia
11-16-2010, 06:54 PM
I am a bit confused why the TC would confuse things, though I have suspected the same problem myself. The software does correctly record the focal length correctly when a TC (at least the ones I have) is used. This is not an issue with exifTool, I think - it is how Nikon in my case reports it. Looks like both Nikon and Canon could use some improvement in this regard :-)

Roy Churchill
11-21-2010, 12:16 PM
I am not sure how accurate the distance is. I am looking in bridge at 30 or so long distance shots I took with the Canon 300/2.8 + 1.4 tc and there are only three different distances recorded for the whole 30 shots : 25.5 mtrs , 46.4 mtrs or infinity. These shots were from different places and different distances so it is too much of a coincidence that several of the shots were taken at exactly the same distance. Maybe it is the converter that is throwing it off (Canon tc).
BTW at what point does it become infinity for a particular lens - is there a way of calculating it?

Roger Clark
11-21-2010, 02:17 PM
I am not sure how accurate the distance is. I am looking in bridge at 30 or so long distance shots I took with the Canon 300/2.8 + 1.4 tc and there are only three different distances recorded for the whole 30 shots : 25.5 mtrs , 46.4 mtrs or infinity. These shots were from different places and different distances so it is too much of a coincidence that several of the shots were taken at exactly the same distance. Maybe it is the converter that is throwing it off (Canon tc).
BTW at what point does it become infinity for a particular lens - is there a way of calculating it?

Roy,

The formula is: 1/F = 1/A + 1/B,
where A and B are the distance to the subject and the back focal distance, and F is the focal lenght.

In your examples:

B = 1/(1/F - 1/A), F=0.3 meters, and

A= 25.5 m, B=303.57 mm
A= 46.4 m, B=301.95 mm
A= infinity, B=300.00 mm

That seems like plenty of movement of the focal plane, but what we don't know is how far the focusing element had to be moved, which is almost certainly much smaller. Distance accuracy will increase as one moves closer to the subject. Seems odd to be so quantized.

Roger