c# detect facial features

General information about Neurotechnology and its software

c# detect facial features

Postby longbowsolution » Jun 18, 2018 07:08

Hi, how can i detect facial features accurately?? i use the following code, but keep give wrong information. i tried to capture the image from camera with mouth closed but 'mouth open' return true? and captureed with mouth opened, but return false.

Code: Select all
var task = biometricClient.CreateTask(NBiometricOperations.Capture | NBiometricOperations.DetectSegments | NBiometricOperations.Segment | NBiometricOperations.AssessQuality, subject);

               Console.Write("Starting to capture. Please look into the camera... ");
               biometricClient.PerformTask(task);
               Console.WriteLine("Done.");

               if (task.Status == NBiometricStatus.Ok)
                   PrintFaceAttributes(face);

private static void PrintFaceAttributes(NFace face)
      {
         foreach (var attributes in face.Objects)
         {
            Console.WriteLine("\tlocation = ({0}, {1}), width = {2}, height = {3}",
               attributes.BoundingRect.X, attributes.BoundingRect.Y, attributes.BoundingRect.Width, attributes.BoundingRect.Height);

            PrintNleFeaturePoint("LeftEyeCenter", attributes.LeftEyeCenter);
            PrintNleFeaturePoint("RightEyeCenter", attributes.RightEyeCenter);

            if (NLicense.IsComponentActivated(AdditionalComponents))
            {
               PrintNleFeaturePoint("MouthCenter", attributes.MouthCenter);
               PrintNleFeaturePoint("NoseTip", attributes.NoseTip);
               Console.WriteLine();
               foreach (var featurePoint in attributes.FeaturePoints)
               {
                  PrintBaseFeaturePoint(featurePoint);
               }

               if (attributes.MouthOpenConfidence == 255) Debug.WriteLine("\t\tMouth open not detected");
               else Debug.WriteLine("\t\tMouth open: {0}, Confidence: {1}", (attributes.Properties & NLProperties.MouthOpen) == NLProperties.MouthOpen, attributes.MouthOpenConfidence);
               
            }
            Console.WriteLine();
         }
      }

longbowsolution
 
Posts: 6
Joined: May 31, 2018 14:02

Re: c# detect facial features

Postby MartynasV » Jun 18, 2018 13:57

longbowsolution wrote:Hi, how can i detect facial features accurately?? i use the following code, but keep give wrong information. i tried to capture the image from camera with mouth closed but 'mouth open' return true? and captureed with mouth opened, but return false.

Code: Select all
var task = biometricClient.CreateTask(NBiometricOperations.Capture | NBiometricOperations.DetectSegments | NBiometricOperations.Segment | NBiometricOperations.AssessQuality, subject);

               Console.Write("Starting to capture. Please look into the camera... ");
               biometricClient.PerformTask(task);
               Console.WriteLine("Done.");

               if (task.Status == NBiometricStatus.Ok)
                   PrintFaceAttributes(face);

private static void PrintFaceAttributes(NFace face)
      {
         foreach (var attributes in face.Objects)
         {
            Console.WriteLine("\tlocation = ({0}, {1}), width = {2}, height = {3}",
               attributes.BoundingRect.X, attributes.BoundingRect.Y, attributes.BoundingRect.Width, attributes.BoundingRect.Height);

            PrintNleFeaturePoint("LeftEyeCenter", attributes.LeftEyeCenter);
            PrintNleFeaturePoint("RightEyeCenter", attributes.RightEyeCenter);

            if (NLicense.IsComponentActivated(AdditionalComponents))
            {
               PrintNleFeaturePoint("MouthCenter", attributes.MouthCenter);
               PrintNleFeaturePoint("NoseTip", attributes.NoseTip);
               Console.WriteLine();
               foreach (var featurePoint in attributes.FeaturePoints)
               {
                  PrintBaseFeaturePoint(featurePoint);
               }

               if (attributes.MouthOpenConfidence == 255) Debug.WriteLine("\t\tMouth open not detected");
               else Debug.WriteLine("\t\tMouth open: {0}, Confidence: {1}", (attributes.Properties & NLProperties.MouthOpen) == NLProperties.MouthOpen, attributes.MouthOpenConfidence);
               
            }
            Console.WriteLine();
         }
      }


Hello longbowsolution,

First of all, you have to be aware that algorithms do mistakes - they don't work in complete 100% accuracy.
About your issue, please send your problematic images with issue description to support@neurotechnology.com also provide SDK revision number(can be found in SDK root directory, in Revision.txt file).
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 370
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 1 guest