Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

if you're using opencv3 (it won't work with 2.4), you can do it easily like this:

String xml = "<xml> ....";
FileStorage fs( xml, FileStorage::MEMORY );

CascadeClassifier cascade;
cascade.read( fs.getFirstTopLevelNode() );

if you're using opencv3 a cascade made from train_cascade (it won't work with 2.4), the older ones from haar_training), you can do it easily like this:

String xml = "<xml> ....";
FileStorage fs( xml, FileStorage::MEMORY );

CascadeClassifier cascade;
cascade.read( fs.getFirstTopLevelNode() );