python中的各种图像读取
对于python中的图像读取做个总结
skimage
- skimage.io.read(path) RGB通道,numpy
- skimage.io.imshow(arr) (height,width, channel)
- skimage.io.imsave(path, image)
- skimage.color.rgb2gray(img)
- skimae.color.convert_colorspace(img,‘RGB’,‘HSV’)
- 子模块:
cv2
- img = cv2.imread(path) BGR numpy
- cv2.imwrite(path, img)
Image
- img = Image.open(open) PIL类型
- img.save(path)
- print img.size #图片的尺寸
- print img.mode #图片的模式
- print img.format #图片的格式
- print(img.getpixel((0,0)))#得到像素值三个通道: