控制台输出深度数据:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Kinect; namespace HelloKinectMatrix
{ class Program
{
static void _kinect_DepthFrameReady(Object sender, DepthImageFrameReadyEventArgs e)
{
// 获取Kinect深度数据,并将深度值打印到控制台上
using(DepthImageFrame depthFrame=e.OpenDepthImageFrame())
{
if(depthFrame!=null)
{
short[] depthPixelData = new short[depthFrame.PixelDataLength];
depthFrame.CopyPixelDataTo(depthPixelData); foreach (short pixel in depthPixelData)
{
Console.Write(pixel);
}
}
}
}
static void Main(string[] args)
{ if (KinectSensor.KinectSensors.Count>)
{
// 设置控制台前景色
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Welcome to the Kinect Matrix ... "); // 默认选择第一个Kinect传感器
KinectSensor _kinect = KinectSensor.KinectSensors[]; _kinect.DepthStream.Enable();
_kinect.DepthFrameReady += new EventHandler<DepthImageFrameReadyEventArgs>(_kinect_DepthFrameReady);
_kinect.Start(); // 按回车键退出
while (Console.ReadKey().Key != ConsoleKey.Enter)
{
} // 关闭Kinect传感器
_kinect.Stop();
Console.WriteLine("Exit the Kinect Matrix ... ");
}
else
{
Console.WriteLine("Please check the kinect sensor ");
} }
}
}

还是对C#很不熟悉,知道每条代码的含义,但自己写不出来 —— 缺乏整体架构

最新文章

  1. SSISDB1:使用SSISDB管理SSIS Projects
  2. 读javascript高级程序设计13-JSON
  3. Linux系统管理员踢用户的方法
  4. meta的学习记录
  5. tomcat源码导入eclipse步骤
  6. Android基本知识
  7. Web应用程序安全必须重视八大问题
  8. Oracle 收集统计数据
  9. VBS调用windows api函数(postmessage)实现后台发送按键脚本
  10. xtrabackup数据库备份
  11. vue视频学习笔记06
  12. Java学习笔记--脚本语言支持API
  13. JSON 数据操作
  14. python3 练手实例8 批量命名图片
  15. 武汉软件开发:一看就会的wpf入门教程
  16. Codeforces379 F. New Year Tree
  17. go build 和 go run区别
  18. cf609E Minimum Spanning Tree For Each Edge (kruskal+倍增Lca)
  19. centos7在upgrade的时候显示:Delta RPMs disabled because /usr/bin/applydeltarpm not installed
  20. [leetcode]199. Binary Tree Right Side View二叉树右侧视角

热门文章

  1. Debian9.5 系统Samba配置说明
  2. git 和github 关联
  3. Xshell6连接Ubuntu18.04
  4. ubuntu 安装Gremlin 的图形化环境
  5. C++输入流
  6. C++ 容器(一):顺序容器简介
  7. PatentTips - Posting interrupts to virtual processors
  8. Spring 容器(一)
  9. UVa 11849 - CD
  10. jquery 表单重置通用方法