How to create,update,delete an face stored .xml
Hi ,
How I could to do update / insert (new face) in file .xml already stored ?
My propose is delete, insert and update.
I tried to to update an face in file .xml I used the class FaceRecognition of javacv's example FaceRecognition.java
What I did ? I use APPEND (CV_STORAGE_APPEND) at file, to preserve face already trained.
fileStorage = cvOpenFileStorage("facedata.xml", // filename
null, // memstorage
CV_STORAGE_APPEND, // flags APPEND instead of CV_STORAGE_WRITE
null); // encoding
The CV_STORAGE_APPEND was successfuly, But the TAG from XML called: <avgTrainImg> and <projectedTrainFaceMat> is created once for all faces, and this method APPEND it create more than one tag <avgTrainImg>... occured Error when Load xml again.
Finding out another alternatives: I read an question about it How to add more data in previously stored trained data file? , but not has the solution. So I tried use
com.googlecode.javacv.cpp.opencv_contrib.createLBPHFaceRecognizer
But: I was faced with the Exception, In this point described below:
faceRecognizer.train(trainImages, trainLabels);
Exception:
Training Binary model ....OpenCV Error: The function/feature is not implemented (Using Original Local Binary Patterns for feature extraction only works on single-channel images (given 16). Please pass the image data as a grayscale image!) in cv::elbp, file \opencv\modules\contrib\src\facerec.cpp, line 646 java.lang.RuntimeException: ........\opencv\modules\contrib\src\facerec.cpp:646: error: (-213) Using Original Local Binary Patterns for feature extraction only works on single-channel images (given 16). Please pass the image data as a grayscale image! in function cv::elbp
at com.googlecode.javacv.cpp.opencv_contrib$FaceRecognizer.train(Native Method)
Some expert could help me ?
Any suggestion is welcome !
most of the answer is already in your errormsg - you only can update the lbph model.
also, please don't try to edit the xml file, instead:
I'm newbie in opencv , could you show me some solution; at least lbph model ? please ?
pardon ? i did not understand.
also sorry, i can help you only with general opencv issues, but not with things related to javacv's api