Software Archive
Read-only legacy content
17061 Discussions

SetDatabaseBuffer loading dynamically

Hashim_K_
Beginner
247 Views

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
Reply