On high resultion jpg files imread then imwrite change the image orientation [closed]
My system
OpenCV version: 2.4.13
Host OS: Windows 8.1
python 2.7
Windows photo viewer to view the images.
imreading and then imwrite a picture that was taken from a high resolution camera chances the picture orientation
=============== python code ====================
import numpy as np
import cv2
img = cv2.imread('1-0.jpg')
cv2.imwrite('1-1.jpg',img)
1-0.jpg size = 19.1 MB (20,065,690 bytes)
1-1.jpg size = 9.05 MB (9,492,507 bytes)
i don't think, this is a matter of resolution.
since some weeks, opencv looks at the exif data in jpeg, and respects the orientation while reading, but that part is not exposed to you at all, so you're unable to (save it somewhere and) "rotate it back to the original orientation" when using imwrite later.
@sturkmen, you probably know better, than me ;)
i have nothing to say after Alexander Alekhin's answer see also this post