- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I've created a small face recognition program, based on the SDK documentation and I believe the detected user is not registering to the database as it should. The program only returns "New USER registered: -1" (which is the return value for QueryUserID() for an unregistered user) . I must be doing something wrong there...
I am pasting the code in here, can anyone help please?
PXCFaceConfiguration *facecfg = faceModule->CreateActiveConfiguration(); PXCFaceConfiguration::RecognitionConfiguration *rcfg = facecfg->QueryRecognition(); // Enable face recognition: rcfg->Enable(); // Create a recognition database: PXCFaceConfiguration::RecognitionConfiguration::RecognitionStorageDesc desc={}; desc.maxUsers =10; rcfg->CreateStorage(L"DB1", &desc); rcfg->UseStorage(L"DB1"); // Set the Face Registration Mode: rcfg->SetRegistrationMode(PXCFaceConfiguration::RecognitionConfiguration::REGISTRATION_MODE_CONTINUOUS); facecfg->EnableAllAlerts(); facecfg->ApplyChanges(); facecfg->Release(); PXCFaceData *fdata = faceModule->CreateOutput(); fdata->Update(); if (fdata == NULL) { wprintf_s(L"PXCFaceData fdata is NULL!!!\n"); } wprintf_s(L"Number of faces detected: %d \n", fdata->QueryNumberOfDetectedFaces()); if(fdata->QueryNumberOfDetectedFaces()>0) { PXCFaceData::Face *faceData = fdata->QueryFaceByIndex(0); PXCFaceData::RecognitionData *recognitionData = faceData->QueryRecognition(); if (recognitionData != NULL) { // recognize the current face? pxcI32 uid = recognitionData->QueryUserID(); if (uid >= 0) { // User recognized: wprintf_s(L" USER recognized: %d\n", uid); } else { recognitionData->RegisterUser(); wprintf_s(L" New USER registered: %d\n", recognitionData->QueryUserID()); } } } fdata->Release();
Thank you and Happy New Year!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see the link below which is the forum topic for the same:
https://software.intel.com/en-us/forums/topic/536453
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Linda!
I understand the User ID incremental problem, which is described in your link, but the problem posted here is that I cannot register the user to the database... even if I perform RegisterUser() and straight afterwards I perform QueryUserID(), I still get -1 in return.
Any ideas?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try on demand instead of continuous registration mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Colleen!
I solved the problem: it was simply the mistake that I was creating the database in the while (AcquireFrame) loop, thus having a new database each frame...
Thank you!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page