This is a Cv2 error regarding the Cascase Classifier

I’m getting the following error:

cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function ‘cv::CascadeClassifier::detectMultiScale’

How can this be solved?

Hey @Swarad, make sure you have haarcascade file present in the same folder as in .py file. If it is not there you can download it from here,

If it is already present, than share your code after saving it on cb.lk/ide.

HOpe thies resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.