Face Recognition doesn't identify more than one person

Face Recognition doesn't identify more than one person

Hi all!

I'm working with the face tracking and I have some issue when running the sample face_recognition which comes with the PerC SDK :(

This is the description of what I have done: 

  • I start the sample. Focused in the camera there is a single person (A)
  • I record correctly its face data
  • The face of A is correctly identified by the sample app
  • A moves from the camera (it isn't focused anymore) and a different person (B) comes in view
  • the sample identifies the face of B as it would be A

This is strange to me because I expect that, when B is focused by the camera, the sample app doesn't recognize him as A. I expect that that B is recognized as a new person, which allows me to record the face data of B as I did with A. After that, the app should be able to correctly identify A and B as two different people.

Why it isn't working? Is there something which I am missing? I have made some test with the code, it seems that the compare method always returns the first element of the array which have all the face models stored. 

I hope I was able to explain my problem, if needed I'll write more.

Thanks in advance :D


9 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hi Mike, you might need to give a bit more information. Facial recognition should be able to distinguish between people, maybe unless they are twins, or close to twins :-)


Thanks for the answer!

I agree that different person should be distinguished. The test I have made involved two completely different people. This happens if I run the C++ SDK's sample code and this VB code (http://software.intel.com/it-it/articles/introduzione-a-intel-perceptual...). This happens in both windows7 and windows8, my ide is VisualStudio2012.

Basically, my probelm is that the app doesn't associate correctly the visualized face with one of the stored ones. The face is correctly identified in the frame but it gets the wrong label.

It seems to me that the problem comes from the 'Compare' method of the 'PXCFaceAnalysis::Recognition::Model' class. In the code there is this line:

sts = curModel->Compare(models, nmodels, scores, &index);

where 'curModel' is 'PXCFaceAnalysis::Recognition::Model' and holds the model of the face which have to be identified. The parameter of the method (from SDK documentation) are:
-models: The pointer to a list of the Model instances.
-nmodels: The number of models.
-scores: Optional pointer to an array of likelihood scores to be returned. The score indicates the similarity of the model to the corresponding model in the list.
-index: The index of the most similar model, to be returned.

I have verified that the 'Compare' method always returns an index equals to '0', which causes the first element of the 'models' array to be chosen and this happens whichever 'curModel' calls the 'Compare' method. 
Moreover, looking at the 'scores' array I noticed that its elements equal '1'. I think the 'Compare' method, for some reasons, identifies all the elements of 'models' as the possible one, gives at each of them the maximum likelihood, and returns the first one. 
So, it works when it has to recognize a single person, it doesn't work anymore when it has to recognize more than one person. 

This problem happens when:
- I have stored the face model of A and B is looking in the camera (recognized as A) -> first element of 'models' is A
- I have stored both A and B face models and B is looking in the camera (recognized as A) -> first element of 'models' is A

Is there a bug of the mehod? Am I missing a specific setting? Can I serialize the face-models in arrays of bytes and write my own compare method which compares the arrays each other byte by byte?

Attached there is the C++ code I'm running. 

I hope it's more clear now :)
Thanks again!!




Downloadtext/x-c++src face_recognition_0.cpp4.85 KB

Some additional detail.. I have quickly written my own Compare method which converts the faceModel-to-be-identified 'curModel' and the stored faceModels into byte array. I run it in the code I posted before and I got the same behaviour described in the previous post. My method is:

pxcU32 index;
pxcBYTE *curModelBuffer = new pxcBYTE[rInfo.modelSize];

for (int i = 0; i < (signed)nmodels; i++){
  pxcBYTE *buffer = new pxcBYTE[rInfo.modelSize];
  wprintf_s(L"- serialize: %i, size: %i, ", i, rInfo.modelSize);
  int n=memcmp ( buffer, curModelBuffer , rInfo.modelSize );
    index = i; 


Since both PerC 'Compare' method and 'MyCompare' method (if it is correct) behave in the same way, may the error be in che 'CreateModel' method?? Any idea?

Thanks again!!

Any update on this issue? Do I have to provide more details?

I too am seeing the exact same issue.  It appears as though the only model included in the search is the first one in the list.

Any updates on this issue would be appreciated.

This appears to be a known issue, I haven't tested this since R6, so never came across it.

See the thread here: http://software.intel.com/en-us/forums/topic/498735

R8 is out, I suggest you try the sample with the latest version.

OK, so just tested R8, even used the binary directly from the download: face_recognition_d.exe

The problem appears to persist with R8, all faces are recognized as the first face. Using previous code, the same problem occurs, so this appears to be an issue with the SDK.

David, if you see this, could someone please take a look?

It is a known issue in R8 and we will fix it in the future release. Thanks!

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi