Image.frombytes和np.fromstring 读取Raw图像速度比较
pillow 5.3.0
python 3.6
numpy 1.15.4
opencv-python 4.0
def readRaw_PIL(filename,height,width,depth,channel=1):
img_size=int(height*width*depth/8*channel)
if depth==8:
datatype='L'
elif depth==16:
datatype="I;16"
with open(filename,'