Mjrovai / OpenCV-Face-Recognition

Real-time face recognition project with OpenCV and Python
1.18k stars 1.02k forks source link

Error in face detection code #13

Closed nagarajansriram closed 1 month ago

nagarajansriram commented 4 years ago

while running face detection code faces = faceCascade.detectMultiScale(gray,scaleFactor=1.2,minNeighbors=5,minSize=(20,20))

got error as

error: OpenCV(4.1.0) /io/opencv/modules/objdetect/src/cascadedetect.cpp:1658: error: (-215:Assertion failed) !empty() in function 'detectMultiScale'

please help me to resolve. thanks in advance.

Avant-Gardiste commented 4 years ago

Probably, the XML or file is missing or the path to it is incorrect.

vaishaliisingh commented 1 month ago

Ensure the Correct Path to the Haar Cascade File, Verify the Haar Cascade File Exists, Handle the Case Where the Cascade File Fails to Load, Ensure OpenCV is Installed Properly, Check for Dependencies