Software Archive
Read-only legacy content
17061 Discussions

Why the output is 0

Iceland_g_
Beginner
152 Views

Why the output is 0 

              Int32 nfaces = fdata.QueryNumberOfDetectedFaces();
              Console.WriteLine(nfaces);//Why the output is 0

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // Create the SenseManager instance
            PXCMSenseManager sm = PXCMSenseManager.CreateInstance();
            // Enable face trackcing
            sm.EnableFace();
            // Initialize the pipeline
            sm.Init();
            // Stream data
            while (sm.AcquireFrame(true).IsSuccessful())
            {
                // Get a face instance here (or inside the AcquireFrame/ReleaseFrame loop) for configuration
                PXCMFaceModule face = sm.QueryFace();
                // face is a PXCMFaceModule instance
                PXCMFaceData fdata = face.CreateOutput();
                // Get the number of tracked faces
                Int32 nfaces = fdata.QueryNumberOfDetectedFaces();
                Console.WriteLine(nfaces);//Why the output is 0

                // Clean up
                fdata.Dispose();
            }
            // Clean up
            sm.Dispose();
        }
    }
}

0 Kudos
0 Replies
Reply