Load cascade classifier from memory?
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.
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.
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.
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.
I have put an valid implementation about this on github. see https://github.com/pengx17/facedetect/blob/master/src/facedetect.cpp
Asked: 2013-01-17 04:46:56 -0600
Seen: 2,051 times
Last updated: Feb 25 '14
Desktop Java - how to load video file?
Fish detection. Is haartraining a good approach ?
Performance evaluation for detection
Earth Mover's Distance EMD() results in memory access error
Human detector using HAAR cascades has too many false positives it is confident about
Error in parameter of traincascade?
Mergevec.cpp : Error (compilation)