# 1 load 2 info 3 resize 4 check
import cv2

img = cv2.imread("image0.jpg", 1)
imgInfo = img.shape
print(imgInfo)

  

可能是因为没有设置路径,所以返回的类型是None。

改正的方法是,读取图片时把路径也写上

import cv2

img = cv2.imread(r"D:\PythonCode\neuron\image0.jpg", 1)
imgInfo = img.shape
print(imgInfo)

  

相关文章:

  • 2021-06-13
  • 2022-01-08
  • 2022-01-29
  • 2021-11-20
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案