Enrollment of face template using Surviliance SDK

General information about Neurotechnology and its software

Enrollment of face template using Surviliance SDK

Postby mprasanna » Dec 15, 2017 02:25

Hi,

I am trying to develop an application where I wish to enroll face templates from camera. During surveillance if the face is detected then it should identify the face from the template and return the matched template. Using the sample code I am able to get the event when the subject is appeared. I want to know how can I proceed with the template enrollment so that I can store the templates in a folder and then match against the subject. Please guide me if there are any samples for this. I am using surveillance SDK only.

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

Re: Enrollment of face template using Surviliance SDK

Postby MartynasV » Dec 15, 2017 11:54

mprasanna wrote:Hi,

I am trying to develop an application where I wish to enroll face templates from camera. During surveillance if the face is detected then it should identify the face from the template and return the matched template. Using the sample code I am able to get the event when the subject is appeared. I want to know how can I proceed with the template enrollment so that I can store the templates in a folder and then match against the subject. Please guide me if there are any samples for this. I am using surveillance SDK only.

Thanks and regards,
Prasanna

Hello Prasanna,

Best template from whole track (period while face was visible to camera) will be kept in OnSubjectDisapeared event. Still some details in this event can be no longer available – like current video frame will no longer have subject’s face, as it has disappeared. Some clients tend to do their own logic – use some details from OnSubjectTrack event and some details from OnSubjectDisappeared event. Or you can check our SurveillanceSample source codes provided to see our suggested implementation. (Add Template button for subject becomes available after subject disappears, but details are gathered from all events).

"SDK\Tutorials\Surveillance\CS\WatchListCS", in this tutorial you enroll templates to NSurveillance object and then it matches those templates against faces detected in front of a camera:
Code: Select all
      static void SurveillanceSubjectDisappeared(object sender, NSurveillanceEventArgs e)
      {
         foreach (var details in e.EventDetailsArray)
         {

            Console.Write("[{0}] [{1}] Subject disappeared", details.TimeStamp.ToString(TimeStampFormat), details.TraceIndex);
            NSurveillanceEventDetails.BestMatchCollection matches = details.BestMatches;
            if (matches.Count == 0)
            {
               Console.WriteLine(", subject not found in the watch list");
            }
            else
            {
               Console.WriteLine(", subject found in the watch list, best matches (score, template id):");
               for (int i = 0; i < matches.Count; ++i)
               {
                  Console.WriteLine("\t{0}. {1} {2}", i, matches[i].Score, matches[i].Id);
             
               }
            }
            details.Dispose();
         }
      }


You can save template to a file this way:
Code: Select all
File.WriteAllBytes(PATH, template.ToArray());
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 313
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 10 guests

cron