用于Kinect深度视图和WPF的InteropBitmaps。 [英] InteropBitmaps for Kinect Depth view and WPF.

查看:69
本文介绍了用于Kinect深度视图和WPF的InteropBitmaps。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新的SDK中,骨架视图示例使用Microsoft.Samples.Kinect.WpfViewers来显示深度和RGB数据。这与前面的例子中的bitmapsource有什么区别?使用任何一个时,性能是否有差异?
另外,在项目中使用它的正确方法是什么?到目前为止,我已经采用了以下方法,但我并不确定imageHelper的功能是什么。谢谢,

In the new SDK the skeleton view example uses Microsoft.Samples.Kinect.WpfViewers to display depth and RGB data. What is the difference between that and bitmapsource from the previous examples? Is there a difference in performance when using either one? Also, what is the proper way to use it in a project? So far I've resorted to the following, but I'm not exactly sure that the function of imageHelper is. Thank you,

 

image_Kinect = e.ImageFrame.Image;

image_Kinect = e.ImageFrame.Image;

if(imageHelper = = null)

if (imageHelper == null)

{

imageHelper = new InteropBitmapHelper(image_Kinect.Width,image_Kinect.Height,image_Kinect.Bits);

imageHelper = new InteropBitmapHelper(image_Kinect.Width, image_Kinect.Height, image_Kinect.Bits);

im_kinect.Source = imageHelper.InteropBitmap;

im_kinect.Source = imageHelper.InteropBitmap;

}

else

{

imageHelper.UpdateBits(image_Kinect.Bits);

imageHelper.UpdateBits(image_Kinect.Bits);

im_kinect.Source = imageHelper.InteropBitmap;

im_kinect.Source = imageHelper.InteropBitmap;

}

推荐答案

KinectColorViewer中有评论,

There's a comment in KinectColorViewer,

      ;       // interopBitmap是一个WPF结构,可以重置图像的位。

            //这比每帧执行一次BitmapSource.Create调用更有效。

因此它只是一种从PlanarImage到ImageSource的更有效方式。

            //An interopBitmap is a WPF construct that enables resetting the Bits of the image.
            //This is more efficient than doing a BitmapSource.Create call every frame.
so it's just a more efficient way of going from a PlanarImage to an ImageSource.


这篇关于用于Kinect深度视图和WPF的InteropBitmaps。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆