Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mat to String and back in OpenCV4Android

I am doing face recognition using opencv4android and JavaCV. I did the face detection in OpenCV and create LBP histogram through JavaCV Face Recognizer class. I want to save this histogram in database. The histogram is in Matvector type. presently i am saving the model into xml file using the model.save method. and then parse the xml and take the histogram into string. I want to use opencv4android method compareHist(Mat,Mat,int) for comparison so I need to convert this string back to Mat. How can i do it using OpenCV4andorid?

Mat to String and back in OpenCV4Android

I am doing face recognition using opencv4android and JavaCV.

I did the face detection in OpenCV and create created the LBP histogram through JavaCV Face Recognizer class. Now I want to save this histogram in a database.

The histogram itself is in the Matvector type. presently i type, considering I am saving the model into an xml file using the model.save model.save() method. and then Then I parse the xml and take the histogram into string.

I want to use opencv4android method compareHist(Mat,Mat,int) for comparison so I need to convert this string back to Mat.

How can i do it using OpenCV4andorid?