简体   繁体   中英

Why the view of some photos read by cv2.imread and plt.imread are different?

I have some photos taken by UAV, and I find that the view of some photos read by cv2.imread and plt.imread are different, one of them is upside down (180° rotation), but most photos are the same.

Why?

Unlike matplotlib (PIL), opencv takes EXIF information into account by default, see documentation :

If EXIF information is embedded in the image file, the EXIF orientation will be taken into account and thus the image will be rotated accordingly except if the flags IMREAD_IGNORE_ORIENTATION or IMREAD_UNCHANGED are passed.

(to achieve the same with PIL, use exif_transpose )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM