SystemError: <class ‘cv2.cascadeclassifier’=””> returned a result with an error set
penCV Error: Parsing error (lbpcascade_animeface.xml(6685): Preliminary end of the stream) in icvXMLParseTag, file D:\Build\OpenCV\opencv-3.4.0\modules\core\src\persistence.cpp, line 2681 cv2.error: D:\Build\OpenCV\opencv-3.4.0\modules\core\src\persistence.cpp:2681: error: (-212) lbpcascade_animeface.xml(6685): Preliminary end of the stream in function icvXMLParseTag The above exception was the direct cause of the following exception: Traceback (most recent call last): File "head.py", line 32, in detect(filename) File "head.py", line 10, in detect cascade = cv2.CascadeClassifier(cascade_file) SystemError: <class 'cv2.cascadeclassifier'=""> returned a result with an error set
解决办法: