Ask Your Question

Revision history [back]

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.