- cv2方法:
image = cv2.imread(file)
返回:numpy of shape (height, width, 3), image[0]=image[1]=image[2]
- skimage方法
image = skimage.io.imread(file)
返回:numpy of shape (height, width)
本文对比了cv2和skimage两种方法读取图片的差异,cv2返回的是一个形状为(height,width,3)的numpy数组,并且可以进行颜色通道的统一设置;而skimage返回的是形状为(height,width)的numpy数组,适用于灰度图。
image = cv2.imread(file)
返回:numpy of shape (height, width, 3), image[0]=image[1]=image[2]
image = skimage.io.imread(file)
返回:numpy of shape (height, width)

被折叠的 条评论
为什么被折叠?