阅读背景:

python图片raw转换成jpg

来源:互联网 
代码: import numpy as np import imageio rawfile = np.fromfile('./_DSC7472.ARW', dtype=np.float32) # 以float32读图片 print(rawfile.shape) rawfile.shape = (896, 13709) print(rawfile.shape) b = rawfile.astype(np.uint8) # 变量类型转换,float32转化为int8 print(b.dtype) imageio.imwrite("0.jpg", b) import matplotlib.pyplot as pyplot pyplot.imshow(rawfile) pyplot.show() 输出: 代码: import numpy as np import imageio rawfile = n



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: