numpy转PIL 报错TypeError: Cannot handle this data type
from PIL import ImageImage.fromarray(np.uint8(img))注意img如果是uint16的矩阵而不转为uint8的话,Image.fromarray这句会报错所以加上np.uint8(img)很有必要File “/usr/local/lib/python2.7/site-packages/PIL/Image.py”, line 1884, in f...
原创
2019-10-13 09:43:23 ·
15342 阅读 ·
11 评论