【发布时间】:2021-04-14 09:44:24
【问题描述】:
我有一个从 cv2.imread 读取的图像,形状是 (2320, 1744, 3)。但是,当我使用 Pillow 时,结果却大不相同:
a = PIL.Image.open('mypic')
a.size # => (2320, 1744)
b = np.asarray(a)
b.shape # => (1744, 2320, 3)
为什么会自动转置?
【问题讨论】:
-
这能回答你的问题吗? Different pixel information in PIL and cv2 另外,我怀疑形状是
(2320, 1744, 3),当用OpenCV打开时,实际宽度是2320。很可能也是(1744, 2320, 3)。
标签: python opencv python-imaging-library