When going through the training stages you might find that your training has come to a halt where its progress isn’t getting any further and or it has exited out improperly. If this happens you can still turn the stages it did successfully complete into a Classifier Cascade XML.

OpenCV comes with a built in cascade conversion utility that seems to work pretty well.

convert_cascade.exe --size="24x24" "C:\MyDocuments\HaarClassifier\haarcascade" haarcascade.xml

Explanation of the code above:

convert_cascade.exe is a utility distributed with the OpenCV library. This is usually contained int the “samples\c” folder in the directory you installed OpenCV.
ex. C:\OpenCV2.2\samples\c

Below are the options available for this utility.

convert_cascade.exe --size="<width>x<height>" <input_cascade_path> <output_cascade_filename>

–size – Is the size dimensions you have specified for your positive detections. In my case –size=”24×24″
input_cascade_path – This is the directory that holds your incomplete haarcascade. From the Training post its the -data “C:\My Documents\HaarClassifier\haarcascade” location
output_cascade_filename – Specify a output name for your xml file. haarcascade.xml

Tags: , ,

Leave a Reply