import numpy as np
import cv2
from matplotlib import pyplot as plt
%matplotlib inline
img=cv2.imread('./test_images/test1.jpg')
gray=cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
face_cascade=cv2.CascadeClassifier('./opencv/haarcascade_frontalface_default.xml')
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
faces
错误 ipython-input-9-a9e6253a492b> in ----> 1 faces = face_cascade.detectMultiScale(gray, 1.3, 5) 2 faces
错误:OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-71670poj\opencv\modules\objdetect\src\cascadedetect.cpp:1689:错误:(-215 :Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale'