为何输出的都是0

Icelandgreenland Icelandgreenland 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
为何输出的都是0

Int32 nfaces = fdata.QueryNumberOfDetectedFaces();
Console.WriteLine(nfaces);//为何输出的都是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();
}
}
}
...全文

相关推荐

评论
收藏 已收藏
分享
返回顶部