Is it possible to convert existing haar cascade files to the old-style for usage with Cuda?

Hello,

Is it possible to convert from a “new-style” (generated by opencv_traincascade) haar .xml file to an “old-style” (generated by opencv_haartraining) file without having access to the training images?

For my specific use-case: I am wanting to use haarcascade_frontalcatface.xml with the cuda version of the cascadeclassifier. I see that the cuda version of this classifier must use only the haar cascade files located under the cuda directory, and that there is no version this specific classifier in that directory. I’ve seen it mentioned that the cuda versions use the old style of .xml haar classifiers. For the differences: is this simply a matter of how the .xml files are structured, such that such a conversion could be possible–or is the floating-point data encoded in a fundamentally different way that this is not possible without the training data? I found a similar question on the old forum but it only applies if you have the training data, which in this case I do not.

Unfortunately, converting new-style Haar cascade files to the old-style format without the training data isn’t straightforward. The old and new formats differ not just in XML structure but also in how some data is encoded, so it’s not just a simple transformation.

1 Like

Thanks, makes sense.