Ask Your Question

Load cascade classifier from memory?

asked 2013-01-17 04:46:56 -0500

tmanthey gravatar image

Is it possible to load a cascade classifier from memory? I would like to store it encrypted on disk and then load the decrypted classifier from memory.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2013-01-17 06:33:06 -0500

CascadeClassifier class has read method that allows you to load cascade from FileNoe of FileStorage. FileStorage can be created in memory. See C++ sample filestorage.cpp as an example of usage FileStorage in memory.

edit flag offensive delete link more


you've got a hint on my below problem?. tia

tmanthey gravatar imagetmanthey ( 2013-01-21 10:07:29 -0500 )edit

answered 2014-02-25 22:10:22 -0500

pengx gravatar image

I have put an valid implementation about this on github. see

edit flag offensive delete link more

answered 2013-01-21 09:57:40 -0500

tmanthey gravatar image

Unfortunately it is not really working out. The problem is that there is now way I know to copy a buffer from Memory to the FileStorage.

I got until here.

    unsigned char cascadeBuffer[102400]; /* contains the complete cascade xml 
    <?xml version="1.0"?>
    </opencv_storage> */

int cascadeBufferLength; // the size of the cascade in the buffer

FileStorage fs("cascade.xml", FileStorage::READ|FileStorage::WRITE|FileStorage::MEMORY | FileStorage::FORMAT_XML);

But now what? I tried FileStorage::writeRaw but thats not quite what the name suggests.

edit flag offensive delete link more


I have the same problem :/ It seems like it only receives a key\data pair.

Obg1 gravatar imageObg1 ( 2013-06-30 06:30:55 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-01-17 04:46:56 -0500

Seen: 1,390 times

Last updated: Feb 25 '14