how to use CascadeClassifier::read?
Hi,
I want to use CascadeClassifier for face detection. I've managed to use it by using the function CascadeClassifier::load("haarcascade_frontalface_alt2.xml"). I want to use the same functinality, but without loading XML file from the disk. I assumed that the way to do it is converting the xml file to some kind of string (static const char* pCascade = "...".) and then use this string to initiate the CascadeClassifier using the function read(const FileNode& node).
My goal is to create an application which uses the CascadeClassifier, WITHOUT forcing the user to place the file "haarcascade_frontalface_alt2.xml" on his disk.
I searched the web and did not find any sample code using the CascadeClassifier read function.
Thanks, Mark
Looking at the docs you can see that there is a note
The file may contain a new cascade classifier (trained traincascade application) only.
. So just to be sure, you aren't using any old models right?Hi Steven,
I don't really know the difference between the old and the new models. My goal is to be able to use opencv cascade classifier to detect faces, without forcing the user to have a file on his disk.
I mean that I want to be able to have a code which is equal to: CascadeClassifier cascade; cascade.load("haarcascade_frontalface_alt2.xml");
The file "haarcascade_frontalface_alt2.xml" is provided with opencv. If the file "haarcascade_frontalface_alt2.xml" is considered an old model, then how can I get the new model of this file?
Thanks, Mark