add option to never rotate photos (ignore Orientation tags)
For computer vision processing of RAW files, it is often essential to work with photos that are consistently oriented with respect to the camera (so that up in the image points towards the top of the camera). However, normally when photos are processed, they are rotated using an Orientation or CameraOrientation tag according to the camera’s orientation with respect to gravity, so that they are presented on screen with up on the screen pointing away from the centre of the Earth.
It would be helpful to have an ART profile option that disables the effect of the *Orientation tags, so that all photos are oriented with respect to the camera.
Comments (4)
-
repo owner -
reporter Thank you so much for investigating this and giving a detailed recipe for achieving it.
Unfortunately, I missed some important context in my initial suggestion. We are using the ART CLI, and in fact we are already doing something quite similar in our ART calling code to detect the orientation and then undo any rotation that ART has applied.
The problem is that we have discovered the orientation logic is quite complicated. For example, with Canon cameras, it seems if the camera has Auto-rotate switched off (it defaults to on), then the Orientation tag and the CameraOrientation tags are different (normally they are the same) and different raw processing engines are interpreting this situation differently. (We are still verifying this Auto-rotate behaviour so take it with a grain of salt.)
We could detect and fix this case, but after looking at the rotation logic (by searching for
flip
indcraw.cc
), it looks quite complex and reversing the rotation in an outer layer seems likely to be fragile and error-prone.I did notice that dcraw includes a
user_flip
parameter inmain()
which disables rotation when it is set to0
. So this behaviour could potentially be emulated inrawimage.cc
. For the libraw case, libraw already exposes theuser_flip
parameter but it’s currently unused by ART.I might experiment with a patch.
-
repo owner Hi, thanks for the explanation. Then let’s say that if you come up with a patch that adds a checkbox in the “raw preprocessing” section to ignore the exif orientation, I’ll be happy to integrate it
-
reporter OK understood, thank you! 🙇♂️
- Log in to comment
Hi,
I think you should be able to do this already with custom dynamic profile rules. The “trick” would be to trigger different rules according to the image orientation value (
Exif.Image.Orientation
tag), in which each of the rule would undo the effect of applying the initial orientation. For example, something like this:where
left_bottom.arp
contains the following:You would need a separate profile for each orientation that you care about, but after that it should work…