Ask Your Question
0

Getting this error - Can anyone assist please?

asked 2018-04-21 02:02:34 -0600

stemcin gravatar image

updated 2018-04-21 02:05:13 -0600

berak gravatar image

Good Morning all,

I was looking for some advice - trying to run a python script utilising opencv 3.4.1 -However I'm getting the below error message. Can anyone help - as I don't know what it means?

"(base) C:\Desktop\python1>python extractfaces.py

OpenCV(3.4.1) Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:\bld\opencv_1520732670222\work\opencv-3.4.1\modules\objdetect\src\cascadedetect.cpp, line 1698
Traceback (most recent call last):
  File "extractfaces.py", line 50, in <module>
    detect_faces(emotion) #Call functiona
  File "extractfaces.py", line 20, in detect_faces
    face = faceDet.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=10, minSize=(5, 5), flags=cv2.CASCADE_SCALE_IMAGE)
cv2.error: OpenCV(3.4.1) C:\bld\opencv_1520732670222\work\opencv-3.4.1\modules\objdetect\src\cascadedetect.cpp:1698: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale

Any advice on the above would be much appreciated.

Kind Regards Stephen

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-04-21 02:05:49 -0600

berak gravatar image

updated 2018-04-25 06:49:56 -0600

your cascade xml file was not loaded. probably the path to it was wrong.

(when in doubt, try with an absolute path first)

if you can't get it to work, then we need more details, you'll need to show us:

  • which cascade file you're trying to load
  • the code, that attempts to do so.
edit flag offensive delete link more

Comments

Bang on - thank you very much !

stemcin gravatar imagestemcin ( 2018-04-21 02:16:12 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-04-21 02:02:34 -0600

Seen: 2,279 times

Last updated: Apr 25 '18