Ask Your Question
2

Load cascade classifier from memory?

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

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
4

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

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

Comments

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

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

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

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>
    <cascade>
    ...
    </cascade>
    </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

Comments

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

Obg1 gravatar imageObg1 ( 2013-06-30 06:30:55 -0600 )edit
0

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

pengx gravatar image

I have put an valid implementation about this on github. see https://github.com/pengx17/facedetect/blob/master/src/facedetect.cpp

edit flag offensive delete link more

Question Tools

Stats

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

Seen: 2,049 times

Last updated: Feb 25 '14