将Kinect深度数据导出到文本文件 [英] Export Kinect Depth Data to Text File
问题描述
感谢您的帮助。我正在研究我的第一个Kinect项目,我正在寻找导出3D深度数据的最佳方法,以供另一方想要分析图像深度的人进行评估。
Thanks for the help. I am working on my first Kinect project and am looking for the best way to export 3D depth data for evaluation by another party who wants to analyze the depth of an image.
我假设我可以使用Depth WPF示例并导出png。但是,当我认为全深度信息应该是16位时,它输出的png只有8位?
//深度帧数据是16位值
          ushort * frameData =(ushort *)depthFrameData;
// depth frame data is a 16 bit value
ushort* frameData = (ushort*)depthFrameData;
如何修改项目以导出完整的16位深度图像?
How do I modify the project to export full 16bit depth images?
当我刚刚更改此行时:
When I just change this line:
//创建要显示的位图
          this.depthBitmap = new WriteableBitmap(this.depthFrameDescription.Width,this.depthFrameDescription.Height,96.0,96.0,PixelFormats.Gray8,null);
// create the bitmap to display
this.depthBitmap = new WriteableBitmap(this.depthFrameDescription.Width, this.depthFrameDescription.Height, 96.0, 96.0, PixelFormats.Gray8, null);
到Gray16,构建立即退出
To Gray16, the build quits right away
推荐答案
如果有一个16位编码器,这将是WPF团队的一个问题。您始终可以使用二进制写入程序保存未压缩的16位数据,因为深度帧不是图像。对于任何图像格式,您实际上都在压缩,这会破坏深度数据
,因为每个像素都是唯一的,对其邻居没有任何意义。
That would be a question for the WPF team if there is a 16bit encoder. You can always save uncompressed 16bit data with a binary writer since the depth frame is not an image. With any image format you are effectively compressing which is going to destroy the depth data since each pixel is unique and has no meaning to its neighbor.
这篇关于将Kinect深度数据导出到文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!