how to develop apps for Kinect

7,238 views
7,054 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,238
On SlideShare
0
From Embeds
0
Number of Embeds
3,103
Actions
Shares
0
Downloads
58
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

how to develop apps for Kinect

  1. 1. Kinect for Windows SDK开发初体验<br />马宁_aawolf<br />
  2. 2. “下面的内容非常严肃”<br />
  3. 3. 八卦一下<br />Kirsten Price<br />小奥的新玩具<br />奥巴马有点烦<br />在亲手击毙了拉登之后……<br />
  4. 4. 再重申一遍:“下面的内容非常严肃”<br />
  5. 5. Agend<br />什么是 Kinect?<br />Kinect历史<br />Kinect for Windows SDK简介<br />设置Kinect开发环境<br />Kinect开发介绍<br />Kinect示例<br />
  6. 6. What’s is Kinect?<br />Kinect是XBox360的外接体感设备<br />动作捕捉<br />语音识别<br />Kinect无需借助任何外设进行动作捕捉<br />目前只支持人类动作的捕捉<br />Rare负责软件开发,Range Camera技术由PrimeSense提供<br />同类产品<br />任天堂 Wii<br />Play Station Move<br />
  7. 7. Kinect History<br />CodeName:Project Natal<br />2009年E3公布,2010年10月上市<br />有史以来销售最快的消费类电子产品<br />截止2011年3月9日,销售超过一千万部<br />2011年6月发布Kinect for Windows SDK<br />动作捕捉的机器学习技术获得2011 MacRobertAward工程创新大奖<br />
  8. 8. 技术指标<br />输出视频帧率为30Hz<br />8-bit VGA 分辨率(640 × 480 pixels)<br />最佳识别区域1.2–3.5 m,扩展区域0.7–6 m<br />可视区域: 水平57° 垂直43°<br />最多跟踪20个人体节点<br />
  9. 9. Kinect for Windows SDK<br />非商业授权,商业授权将在下一个版本中提供<br />OS:Windows 7<br />Visual Studio 2010 Express以上版本<br />支持C++, C# 和 VB.NET<br />主要功能<br />Raw sensor streams<br />Skeletal tracking<br />Advanced audio capabilities<br />
  10. 10. Kinect Hardware<br />
  11. 11. Setting Up Your Development Environment<br />硬件<br />Kinect Hardware<br />AC Adapter/ Power Supply<br />软件<br />Kinect for Windows SDK<br />http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/download.aspx<br />Coding4Fun KinectToolkit<br />http://c4fkinect.codeplex.com/<br />
  12. 12. 添加引用<br />添加引用<br />Microsoft.Research.Kinect<br />Coding4Fun.Kinect.Wpf.dll (可选)<br />命名空间<br />using Microsoft.Research.Kinect.Nui; <br />using Microsoft.Research.Kinect.Audio; <br />using Coding4Fun.Kinect.Wpf;<br />
  13. 13. 初始化Runtime<br />Runtime nui;<br />nui= new Runtime(); <br />nui.Initialize(RuntimeOptions.UseColor| RuntimeOptions.UseDepth<br /> | RuntimeOptions.UseDepthAndPlayerIndex<br /> | RuntimeOptions.UseSkeletalTracking); <br />Runtime<br />封装一个Kinectsensor的功能<br />RutimeOptions<br />指定Kinectsensore能够使用的功能<br />
  14. 14. Camera Fundamentals<br />nui.VideoFrameReady += <br /> new EventHandler<ImageFrameReadyEventArgs>(nui_VideoFrameReady);<br />void nui_VideoFrameReady(object sender, ImageFrameReadyEventArgs e) <br />{ <br />PlanarImageimageData = e.ImageFrame.Image; <br />image1.Source = BitmapSource.Create(imageData.Width, imageData.Height, <br /> 96, 96, PixelFormats.Bgr32, null, imageData.Bits, <br />imageData.Width* imageData.BytesPerPixel); <br />//image1.Source = e.ImageFrame.ToBitmapSource(); <br />}<br />VideoFrameReady事件<br />ImageFrameReadyEventArgs参数<br />ImageFrame.Image属性:PlanarImage<br />使用Coding4Fun Kinect Toolkit<br />
  15. 15. 获取Depth信息<br />nui.DepthFrameReady += <br /> new EventHandler<ImageFrameReadyEventArgs>(nui_DepthFrameReady); <br />nui.DepthStream.Open(ImageStreamType.Depth, 2, <br /> ImageResolution.Resolution320x240, ImageType.Depth);<br />void nui_DepthFrameReady(object sender, ImageFrameReadyEventArgs e) <br />{ <br /> image2.Source = e.ImageFrame.ToBitmapSource(); <br />}<br />
  16. 16. Camera Data<br />
  17. 17. Skeletal Tracking Fundamentals (1)<br />Kinect最多可以追踪20个骨骼点<br />SkeletonFrame<br />骨骼帧<br />Skeletons<br />骨骼点列表<br />
  18. 18. Skeleton API<br />
  19. 19. Skeletal Tracking Fundamentals (2)<br />nui = new Runtime(); <br />nui.Initialize(RuntimeOptions.UseSkeletalTracking); <br />nui.SkeletonFrameReady+= <br /> new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);<br />void nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) <br />{ <br />SkeletonFrameallSkeletons = e.SkeletonFrame; <br />//get the first tracked skeleton <br />SkeletonDataskeleton = (from s in allSkeletons.Skeletons<br /> where s.TrackingState == SkeletonTrackingState.Tracked select s).FirstOrDefault(); <br />} <br />
  20. 20. Working with Depth Data<br />Runtime nui = new Runtime(); <br />private void Window_Loaded(object sender, RoutedEventArgs e)<br />{<br />//UseDepthAndPlayerIndex and UseSkeletalTracking<br />nui.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking);<br />//register for event<br />nui.DepthFrameReady += new EventHandler<ImageFrameReadyEventArgs>(nui_DepthFrameReady);<br />//DepthAndPlayerIndexImageType<br />nui.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240, <br />ImageType.DepthAndPlayerIndex); <br />}<br />void nui_DepthFrameReady(object sender, ImageFrameReadyEventArgs e)<br />{}<br />
  21. 21. Audio Fundamentals<br />
  22. 22. Sample Project<br />光剑<br />虚拟试衣间<br />超级玛丽<br />
  23. 23. 总结<br />Kinect是一种廉价的动作捕捉设备<br />有可能成为鼠标之后计算机交互的新时代<br />在专业领域和消费者领域均有机会<br />专业领域发展会快于消费者领域<br />如何为好的技术寻找成功的应用场景?<br />

×