一、AttributeError: module ‘cv2‘ has no attribute ‘face‘报错
解决方法:
1、用pycharm打开你的代码,然后在pycharm中右键打开终端
2、安装opencv-contrib-python包
pip install opencv-contrib-python
二、anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback报错警告
原代码:
camera = cv2.VideoCapture(0) # 0:开启摄像头
解决方法:修改代码如下
camera = cv2.VideoCapture(0,cv2.CAP_DSHOW) # 0:开启摄像头