python将图像数组打印为纯零的原因是什么?

时间:2019-10-06 17:57:08

标签: python

import numpy as np
import matplotlib.pyplot as plt
from PIL import Image 
import os
i=Image.open(r"C:\Users\Evelyn\Desktop\C33P1thinF_IMG_20150619_114756a_cell_179.png")
iar=np.asarray(i)
    print(iar)

我正在尝试让python在路径中打印图像数组。如果我打印出图像,则可以正确打印,但是当我打印阵列时,所有打印出的图像都是

[[[0 0 0]
          [0 0 0]
          [0 0 0]
          ..., 
          [0 0 0]
      [0 0 0]
      [0 0 0]]

     [[0 0 0]
      [0 0 0]
      [0 0 0]
      ..., 
      [0 0 0]
      [0 0 0]
      [0 0 0]]

     [[0 0 0]
      [0 0 0]
      [0 0 0]
      ..., 
      [0 0 0]
      [0 0 0]
      [0 0 0]]

     ..., 
     [[0 0 0]
      [0 0 0]
      [0 0 0]
      ..., 
      [0 0 0]
      [0 0 0]
      [0 0 0]]

     [[0 0 0]
      [0 0 0]
      [0 0 0]
      ..., 
      [0 0 0]
      [0 0 0]
      [0 0 0]]

     [[0 0 0]
      [0 0 0]
      [0 0 0]
      ..., 
      [0 0 0]
      [0 0 0]
      [0 0 0]]]

有什么办法可以解决这个问题?

0 个答案:

没有答案