Correcting AF Point Positions after rotating Images

Started by suitx, August 22, 2012, 08:57:36 AM

Previous topic - Next topic

suitx

Hi all,

I've written a small script, that uses the cameras AF information stored in the MarkerNotes to create a small 100% crop around the active focus point from the images. That works well for unaltered images, straight out off the cam.

I've a problem with images that were rotated afterwards. (I'm using exiftool to set the orientation tag to "horizontal" after I've rotated my Images using jpegtran.)
I cannot alter the AF-Tags to match the new orientation since they are "Read-only". As a consequence, the cropped area from my script is wrong in those images. Since I'm using a Canon EOS Camera, the tags that deliver the AF point information are [MakerNoteCanon:AFInfo] AFAreaXPositions and Y, respectively. They have to be swapped or rearranged when the image is rotated to portrait mode.

To my question: Is there a tag where the original orientation is stored, so that I can lookup in my AF-Crop-Script if I have to recalculate the AF points' positions to get the correct cropping area of the image?
Or do you have any other idea on how to get the corrected AF Positions when the image was rotated and you no longer know that/how it was rotated.

In the meantime I'm using the UserComment tag to save the original rotation, but I find this a little awkward. Probably there is a more comfortable solution.

-Jan

Phil Harvey

Hi Jan,

Normally the AFArea coordinates do not change with image orientation.

The original orientation is likely stored in the maker notes somewhere, but this is currently only decoded for a few EOS models (the Rotation tag).

I think the best solution could be to write your area information as XMP mwg-rs regions.  Then you even stand a chance of other applications being able to read this down the road.

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