Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
17060 Discussions

SR300——Why the output is 0

Iceland_g_
Beginner
435 Views

SR300——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