解决问题
OpenCV Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp, line 1698
Traceback (most recent call last):
File "F:\File_Python\Python_daydayup\180324.py", line 22, in <module>
flags=cv2.CASCADE_SCALE_IMAGE
cv2.error: C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:1698: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale
解决思路
OpenCV级联检测器Cascadedetect出现错误,可知是xml路径读取错误,不要直接写入相对路径,要改为xml文件所在的绝对路径即可!
解决方法
进行检测一下,哈哈大功告成!