Ask Your Question

Revision history [back]

error starting CascadeClassifier with xml file

I am trying to initialize my Cascade classifier with cascade = cv2.CascadeClassifier(xml_path)

But it raises the error

OpenCV Error: Unknown error code -49 (Input file is empty) in cvOpenFileStorage, file C:\projects\opencv-python\opencv\modules\core\src\persistence.cpp, line 4484
cv2.error: C:\projects\opencv-python\opencv\modules\core\src\persistence.cpp:4484: error: (-49) Input file is empty in function cvOpenFileStorage

I have just downloaded the xml file from https://github.com/opencv/opencv/tree/master/data/haarcascades

What am I missing?

click to hide/show revision 2
retagged

updated 2018-04-17 13:48:53 -0600

berak gravatar image

error starting CascadeClassifier with xml file

I am trying to initialize my Cascade classifier with cascade = cv2.CascadeClassifier(xml_path)

But it raises the error

OpenCV Error: Unknown error code -49 (Input file is empty) in cvOpenFileStorage, file C:\projects\opencv-python\opencv\modules\core\src\persistence.cpp, line 4484
cv2.error: C:\projects\opencv-python\opencv\modules\core\src\persistence.cpp:4484: error: (-49) Input file is empty in function cvOpenFileStorage

I have just downloaded the xml file from https://github.com/opencv/opencv/tree/master/data/haarcascades

What am I missing?