Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
6 Views

SetDatabaseBuffer loading dynamically

Hello,

 

I have an application which inserts the facedata and name of a person in to database using below code.

PXCMFaceData.RecognitionModuleData recognitionModuleData = faceData.QueryRecognitionModule();
 Int32 nBytes = recognitionModuleData.QueryDatabaseSize();
 Byte[] buffer = new Byte[nBytes];
  
 // Retrieve the database buffer
 recognitionModuleData.QueryDatabaseBuffer(buffer);
 ErollFace(userName, buffer); // stores the user name and face data to database.)

Here for recognizing i just take each person face data from database and the buffer is set in SetDatabaseBuffer using below code.

Byte[] buffer = dr.Field<Byte[]>("FaceData");
recognitionConfig.SetDatabaseBuffer(buffer);
recognitionData = face.QueryRecognition();

if (recognitionData.IsRegistered())
{
   userRecognized = dr.Field<String>("UserName");
   userDetected = true;

}

Is this the correct logic to recognize a face? What my understanding is, I get the face data buffer of a person from db and use it in the SetDatabaseBuffer. Then calling face.QueryRecognition(); will check the DatabaseBuffer and compare and recognize. Is it right? If wrong can anyone please guide me here?

0 Kudos
0 Replies