cv::imread - Camera orientation problem
I'm following this guide here to try out CLAHE in Python, so I have the following code:
import numpy as np
import cv2
img = cv2.imread('t1.JPG',0)
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
cl1 = clahe.apply(img)
cv2.imwrite('t1-clahe.JPG',cl1)
Before (t1.JPG):
t1.JPG
After (t1-clahe.JPG):
image description
So, if you see the links provided, the image has been reshaped. There doesn't seem to be any indication in the guide that this should happen. Am I missing something here? I don't want to reshape the image.
Funny thing is that if I output the shape of the image then there seems to be no change. I get the following:
Before: (2448, 3264)
After: (2448, 3264)
But if you look at the after image, it has clearly been reshaped. I noticed another thing. This problem is only happening with images taken from my iPhone 5S. I tried other images and they did not have the same issue. I tried to find differences between the images that are being reshaped and ones that aren't. So, I noticed the following difference:
reshaped : JPEG image data, EXIF standard 2.21
not reshaped: JPEG image data, JFIF standard 1.01
Any help with this problem would be greatly appreciated.
OpenCV version being used: 2.4.8
i do not see any reshape here ?
also, please, for the future, spare us such ridiculous large images
I guess 'reshape' wasn't the correct terminology for this problem. What I meant was that the 'orientation' has changed. As for the images, I didn't think that they would be imbedded into the notification emails since I provided external links
maybe we should rephrase the whole question (as CLAHE has absolutely nothing to do with it) to "problems with image orientation due to EXIF headers" or the like ?
@berak i was editing the question when you were commenting. @Sid23 i edited label of the question but it will be better if you rephrase the whole question.
imho, it's perfect, already ;)