为何输出是0呢

Icelandgreenland 2016-08-29 12:31:31
为何输出是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();
}
}
}

...全文
192 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Icelandgreenland 2016-08-29
  • 打赏
  • 举报
回复
解决了,需要加上fdata.update
Icelandgreenland 2016-08-29
  • 打赏
  • 举报
回复
问题没有解决啊,怎样写才是正确的
Poopaye 2016-08-29
  • 打赏
  • 举报
回复
因为现在是8月份
巴士上的邂逅 2016-08-29
  • 打赏
  • 举报
回复
没识别到!!
tianlang_2008 2016-08-29
  • 打赏
  • 举报
回复
没看错你这里是初始化控件后再取值吧,然后你又没有赋值,那肯定就是0了咯。。
  • 打赏
  • 举报
回复
因为你的方法返回了0……

7,765

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧