2021-10-04_cv2.imread()_AttributeError: ‘NoneType’ object has no attribute ‘shape’
#!/usr/bin/env python
# -*- coding: gbk -*-
import cv2
img_head = cv2.imread('月亮.jpg')
img_flag = cv2.imread('国旗.png')
#获取头像和国旗图案宽度
# ~ w_head, h_head = img_head.shape[0:2]
print(img_head.shape[:2])
尝试输出所获得图片长和宽后报错:
AttributeError: ‘NoneType’ object has
原创
2021-10-04 22:30:52 ·
299 阅读 ·
0 评论