Question on auto detection of face using Verilook

General information about Neurotechnology and its software

Question on auto detection of face using Verilook

Postby mprasanna » Sep 19, 2017 07:12

Hi,

I am doing a project in which it is required to enroll a user first. And after enroll the system should detect any face from the cameras (more than one camera possible including IP camera). If the face matches the enrolled face then access to the door should be enabled. Otherwise it should be disabled.

After going through the samples I am able to enroll face template and also identify the face on a button click. But I am not sure how can I show feed from multiple cameras and automatically detect face. Any pointer in this regard will be very helpful.

Thanks and regards
Prasanna
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Question on auto detection of face using Verilook

Postby vaidasz » Sep 19, 2017 12:50

mprasanna wrote:Hi,

I am doing a project in which it is required to enroll a user first. And after enroll the system should detect any face from the cameras (more than one camera possible including IP camera). If the face matches the enrolled face then access to the door should be enabled. Otherwise it should be disabled.

After going through the samples I am able to enroll face template and also identify the face on a button click. But I am not sure how can I show feed from multiple cameras and automatically detect face. Any pointer in this regard will be very helpful.

Thanks and regards
Prasanna


Hello,

To use multiple cameras you need to create multiple NBiometricClient (one for each camera). And once you capture the face from specific camera, start capturing again.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 551
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Question on auto detection of face using Verilook

Postby mprasanna » Sep 20, 2017 06:27

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
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Question on auto detection of face using Verilook

Postby vaidasz » Sep 20, 2017 07:45

mprasanna wrote: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


Hello,

There is some NSubject null that you try to add to enrollmentTask. This is why you get the issue. Ensure you add NSubjects that are not null.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 551
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Question on auto detection of face using Verilook

Postby mprasanna » Sep 20, 2017 19:39

Thanks for pointing it out. I found the issue and rectified the case where a null NSubject was getting added to enrollment task. Now I have 2 problems
1. I am getting MatchNotFound return code always.
2. If I run the identification in a loop I am getting activation error. But if I do not run it in a loop then how do I detect a face and then trigger Identify process.

Thanks and regards
Prasanna
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Question on auto detection of face using Verilook

Postby vaidasz » Sep 21, 2017 08:46

mprasanna wrote:Thanks for pointing it out. I found the issue and rectified the case where a null NSubject was getting added to enrollment task. Now I have 2 problems
1. I am getting MatchNotFound return code always.
2. If I run the identification in a loop I am getting activation error. But if I do not run it in a loop then how do I detect a face and then trigger Identify process.

Thanks and regards
Prasanna


Hello,

mprasanna wrote:Thanks for pointing it out. I found the issue and rectified the case where a null NSubject was getting added to enrollment task.

Great!

mprasanna wrote:1. I am getting MatchNotFound return code always.

It might be that subjects do not match.
There a matching threshold that you could set for NBiometricClient. If the matching score is equal or higher to the matching threshold set, the matching score is returned. Otherwise, 0 is returned (or MatchNotFound).

mprasanna wrote:2. If I run the identification in a loop I am getting activation error. But if I do not run it in a loop then how do I detect a face and then trigger Identify process.

Please make small test application and send it to support@neurotechnology.com. Do not forget include issue description. Also make sure application includes all necessary files so it could be debugged and run.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 551
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Question on auto detection of face using Verilook

Postby vaidasz » Sep 21, 2017 08:46

Hello,

mprasanna wrote:Thanks for pointing it out. I found the issue and rectified the case where a null NSubject was getting added to enrollment task.

Great!

mprasanna wrote:1. I am getting MatchNotFound return code always.

It might be that subjects do not match.
There a matching threshold that you could set for NBiometricClient. If the matching score is equal or higher to the matching threshold set, the matching score is returned. Otherwise, 0 is returned (or MatchNotFound).

mprasanna wrote:2. If I run the identification in a loop I am getting activation error. But if I do not run it in a loop then how do I detect a face and then trigger Identify process.

Please make small test application and send it to support@neurotechnology.com. Do not forget include issue description. Also make sure application includes all necessary files so it could be debugged and run.[/quote]
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 551
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Question on auto detection of face using Verilook

Postby vaidasz » Sep 25, 2017 08:57

vaidasz wrote:Hello,

mprasanna wrote:Thanks for pointing it out. I found the issue and rectified the case where a null NSubject was getting added to enrollment task.

Great!

mprasanna wrote:1. I am getting MatchNotFound return code always.

It might be that subjects do not match.
There a matching threshold that you could set for NBiometricClient. If the matching score is equal or higher to the matching threshold set, the matching score is returned. Otherwise, 0 is returned (or MatchNotFound).

mprasanna wrote:2. If I run the identification in a loop I am getting activation error. But if I do not run it in a loop then how do I detect a face and then trigger Identify process.

Please make small test application and send it to support@neurotechnology.com. Do not forget include issue description. Also make sure application includes all necessary files so it could be debugged and run.
[/quote]

The issue was that there were Fingerprint Extractor license activated and tried to check ICAO compliance. There is needed Fingerprint Client license.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 551
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Question on auto detection of face using Verilook

Postby mprasanna » Oct 06, 2017 11:12

I removed the part for icao in the code while creating the object. In this case I am not getting the same error. But most of the times I am getting error saying "index is greater than or equal to NList count. Parameter name Index" during the call biometricClient.Identify(targetSubject). On successful runs also I am not getting any matching template even if I set the FacesConfidenceThreshold value to as low as 10.I am calling identify in a timer to identify face of any registered user entering by using a camera.

Please help.

Thanks and regards,
Prasanna
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Question on auto detection of face using Verilook

Postby MartynasV » Oct 09, 2017 13:08

mprasanna wrote:I removed the part for icao in the code while creating the object. In this case I am not getting the same error. But most of the times I am getting error saying "index is greater than or equal to NList count. Parameter name Index" during the call biometricClient.Identify(targetSubject). On successful runs also I am not getting any matching template even if I set the FacesConfidenceThreshold value to as low as 10.I am calling identify in a timer to identify face of any registered user entering by using a camera.

Please help.

Thanks and regards,
Prasanna

Hello Prasanna,

Usually, this error means that you are using incorrect index in the array, but we need to reproduce it to be sure.

Send following to support@neurotechnology.com and don't forget to include issue description:
  • SDK revision number(can be found in SDK root directory, in Revision.txt file).
  • Full exception stack trace.
  • Small test application.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 214
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 3 guests