原文:https://imageio.readthedocs.io/en/latest/scipy.html?highlight=imread
imageio.imread可以代替scipy.misc.imread
用pilmode代替mode
用as_gray代替flatten
pilmode类型:
‘L’ (8-bit pixels, grayscale)
‘P’ (8-bit pixels, mapped to any other mode using a color palette)
‘RGB’ (3x8-bit pixels, true color)
‘RGBA’ (4x8-bit pixels, true color with transparency mask)
‘CMYK’ (4x8-bit pixels, color separation)
‘YCbCr’ (3x8-bit pixels, color video format)
‘I’ (32-bit signed integer pixels)
‘F’ (32-bit floating point pixels)
as_gray:
如果as_gray=True,则用‘F‘模式读取图片;
如果已经设置了pilmode且as_gray=True,图片首先根据pilmode设置的值读取,再用’F’模式压平(flatten)