Mapping "AF Points Used" to images

Started by photomotion, October 02, 2017, 10:15:51 PM

Previous topic - Next topic

photomotion

Hello all,
I feel like this is something that has been done before, so before I re-invent the wheel, I thought I might ask here first.

I'm trying to figure out how to programmatically determine where on my image the camera's focus was when I shot it. My understanding is that (for Nikon cameras at least) this information resides in the MakerNotes under the "AF Points Used" heading. The result of this field is typically a two byte value such as "D7" or "A3". I have two (OK three) questions about this:

1.  Does anyone know how these map to the selectable points you see in the viewfinder? Looking at it, my theory is that it's a coordinate system with A through whatever on the vertical axis, and 1 through whatever on the horizontal.

2. Is there any way to turn this into coordinates on the final images, whether by percentage of screen real estate or by some other measure? And how is that affected by full frame sensors in crop mode, etc. (Maybe you can calculate from the center of the image?) I'm assuming that every camera's AF point distribution is different, so I feel like you'd have to have some sort of translation table for each make/model from AF point identification to layout on the actual image itself.

3. How do other cameras handle this information? I know that there is a Lightroom plugin that allows you to see the layout of the focus points from many different cameras, but I have no idea how they handle it. I'm trying trying to use this from a computer vision perspective and would like to be able to use this information to isolate areas of the image to process.

Thanks!
Rob


Phil Harvey

Quote from: photomotion on October 02, 2017, 10:15:51 PM
1.  Does anyone know how these map to the selectable points you see in the viewfinder? Looking at it, my theory is that it's a coordinate system with A through whatever on the vertical axis, and 1 through whatever on the horizontal.

Exactly.  See the Tag Name documentation for some more information about these tags.

Quote2. Is there any way to turn this into coordinates on the final images, whether by percentage of screen real estate or by some other measure?

ExifTool won't do this for you, so it would be a bit of work.

QuoteAnd how is that affected by full frame sensors in crop mode, etc.

... even more work.

Quoteso I feel like you'd have to have some sort of translation table for each make/model from AF point identification to layout on the actual image itself.

Yup.

Quote3. How do other cameras handle this information? I know that there is a Lightroom plugin that allows you to see the layout of the focus points from many different cameras, but I have no idea how they handle it.

They probably do it just like you said.

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