Thanks for the information. For the time being I considered one camera and moved ahead in enrolling and verifying. I did not find any issue with enroll by following the sample provided. But I am facing issues with Identification.
In the start form I have NFace control showing the stream from the camera. I have a timer on the timer tick I have the following code
- Code: Select all
string id = string.Empty;
id = Global.FaceTemplateMgr.GetIdentifiedFace(_subject);
FaceTemplateMgr is an object of TemplateManager class. In the constructor I read all the templates from the disk and create a list of NSubjects.
In the method GetIdentifiedFace() I pass the NSubject as captured in the main form. The code for GetIdentifiedFace is as below
- Code: Select all
string matchingID = string.Empty;
if (targetSubject != null && _subjects != null && _subjects.Length > 0)
{
try
{
_biometricClient.Clear();
var enrollmentTask = new NBiometricTask(NBiometricOperations.Enroll);
// Create subjects from templates and set them for enrollment
foreach (NSubject t in _subjects)
{
enrollmentTask.Subjects.Add(t);
}
_biometricClient.PerformTask(enrollmentTask);
NBiometricStatus status = _biometricClient.Identify(targetSubject);
if (status == NBiometricStatus.Ok )
{
foreach (var subject in _subjects)
{
bool isMatchingResult = _subject.MatchingResults.Any(result => subject.Id == result.Id);
if (isMatchingResult)
{
matchingID = subject.Id;
MessageBox.Show("Found matching face with id " + matchingID);
}
}
}
}
catch(Exception ex)
{
}
return matchingID ;
}
In this I observed it takes a lot of time for _biometricClient.Clear() call.
Also it throws exception
{Neurotec.NArgumentNullException: hSubject is NULL
Parameter name: hSubject
at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.Collections.ObjectModel.NObjectCollection`1.AddWithOutIndexInternal(T value)
at Neurotec.Collections.ObjectModel.NSimpleCollection`1.AddInternal(T value)
at Neurotec.Collections.ObjectModel.NCollectionBase`1.Add(T item)
at Neurotec.Samples.TemplateManager.GetIdentifiedFace(NSubject targetSubject) in h:\FaceSDK\Neurotec_Biometric_9_0_SDK\Samples\Biometrics\CS\SimpleFacesSampleCS\TemplateManager.cs:line 65}
Please let me know what is the issue and how to resolve it. For simplicity I actually modified the existing sample to create my test application.
Thanks and regards
Prasanna