I’m pretty new to swift (SwiftUI) and making a easy face and card detection app utilizing Imaginative and prescient. Mainly it’s only a digital camera preview layer and upon face/card detection, it crops the picture and shows it on the view. I’m having some issues understanding how picture orientation works.
That is my understanding, right me if I’m mistaken:
In iOS units, after we maintain the digital camera in portrait orientation, the native sensor nonetheless captures the picture in panorama left (so we’ve to rotate the picture 90 deg proper for meant orientation) for the again digital camera. For entrance digital camera, it nonetheless captures in panorama left however moreover it’s mirrored too.
Suppose this pattern picture from internet
I attempted two approaches:
I-) Within the VNImageRequestHandler, I set the orientation to .proper so the captured buffers would rotate to proper however they didn’t. I believed this might work.
II-) Within the digital camera configuration, I set the videoOrientation to AVCaptureVideoOrientation.portrait, this corrected the seize orientation of the buffers.
Now acc to my understanding, if I set the orientation to .up(default) in VNImageRequestHandler, it ought to work proper? The captured buffer was in right orientation however the crop was not making use of appropriately.
However once I set the orientation to .downMirrored in request handler, it labored appropriately, the buffers had been in right orientation and the crop was good too.
Why does .downMirrored (the wrong way up and horizontal flip) work and never the Ist method?

![Hassle understanding ImageOrientation in Swift [closed] Hassle understanding ImageOrientation in Swift [closed]](https://i.sstatic.net/0j2MM3CY.png)


