Ask Your Question
0

cvLoad fails to load cascade.xml (Android)

asked 2014-04-14 21:17:15 -0600

Zuecafajm gravatar image

updated 2015-09-19 12:44:33 -0600

Hello,

I am attempting to load a cascade xml file and am receiving the following error on calling cvLoad:

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in void* cvRead(CvFileStorage, CvFileNode, CvAttrList*), file /home/saudet/projects/javacv-cppjars/opencv-2.4.8/modules/core/src/persistence.cpp, line 4991

I have checked that the xml file exists and is readable. There seem to be a lot of different solutions other people have found for this but none of them have worked for me.

Here is the line that it fails on:

Pointer xmlFile = cvLoad(xmlLocation + xmlName);

You can view my xml file here: http://pastebin.com/6x2QFhrQ

Let me know if there is any other information that can help you identify the problem.

Thanks for your help!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-10-15 06:23:20 -0600

CanAmHack gravatar image

I encountered a similar problem with the Python2 bindings for a classifier I trained myself. The problem stemmed from opencv_traincascade writing the classifier.xml file in the new format instead of the older format that the python lib (cv2.pyd) was expecting. To get around it, I reran opencv_traincascade with the -baseFormatSave flag and then changed the cascade tag in the resulting file to the output type_id="opencv-haar-classifier" tag manually, as explained in bug 2387: http://code.opencv.org/issues/2387.

Note that I didn't need to rerun the training (takes too long!) I just deleted the final cascade.xml from the previous run so that opencv_traincascade simply regenerated the cascade.xml in the old format in a matter of seconds.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-04-14 21:17:15 -0600

Seen: 1,666 times

Last updated: Oct 15 '14