Using Python and OpenCV, I try to read an image which size is (3264*2448), but the resulting size is always (2448*3264). That means the direction of the image is changed by 90 degrees. The code is following:
img1 = cv2.imread("C:\\Users\\test.jpg", 0)
cv2.namedWindow("test", 0)
cv2.imshow("test", img1)
the orignal image is this:
but I get this image:
I faced a similar issue in one program. In my case, the problem was due to the camera orientation data stored in the image.
The problem was resolved after I used CV_LOAD_IMAGE_COLOR
instead of CV_LOAD_IMAGE_UNCHANGED
in OpenCV Java.