from scipy.misc import imread,imshow
img = imread('D:test.bmp')
print img[:,:,2].shape
imshow()

  

 

注意img[:,:,2]的最后一个维度上的值最大为2,因为是RGB图像,最多是3个2维矩阵的叠加。

print img1[:, :, 3] 会产生 IndexError: index 3 is out of bounds for axis 2 with size 3

相关文章:

  • 2021-12-02
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案