在Matlab中保存Kinect深度图像? [英] Save Kinect depth image in Matlab?

查看:575
本文介绍了在Matlab中保存Kinect深度图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过使用Kinect,我可以获得深度图像,其中每个深度图像像素存储相机和对象之间的距离(以毫米为单位)。现在我想保存它们以便以后使用。什么是最好的推荐?

By using Kinect, I can get depth image in which each depth image pixel store the distance(in millimeter) between camera and object. Now I want to save them so that I can use later. What is the best recommendation?

我想将深度图像保存为图像(jpg / png等)。但是,该值通常为50毫米至10000毫米,而普通图像元素可以存储0-255。然后我需要将数据扩展到0-255范围,并且可能以某种方式利用数据。

I am thinking to save the depth image as an image (jpg/png, etc). However, the value is usually from 50 mm to 10000 mm while the normal image element can store from 0-255. Then I will need to scale the data to range 0-255 and that may exploit the data somehow.

推荐答案

您可以使用支持16位灰度图像的任何格式,如tiff或png,因为您的数据适合16位(2 ^ 16-1 = 65535)。

You can use any format like tiff or png that supports 16 bit grayscale images, since your data will fit in a 16 bit (2^16-1=65535).

使用这些格式的好处当然是您可以使用其他程序读取它们。由于压缩工件,你很可能不想使用jpeg格式。

The advantage of using these formats is of course that you will be able to read them using another program. You will most probably not want to use the jpeg format because of compression artifacts.

以下是matlab文档中关于png格式的imwrite的内容:

Here's what the matlab documentation says about imwrite for the png format:

默认情况下,imwrite每像素使用8位,如果image为double或uint8;如果图像是uint16,则每像素16位;如果图像合乎逻辑,则每像素1位。

如果您将数据存储为uint16,那么您已经很好了。

So you'll be already fine if you have your data stored as uint16.

这篇关于在Matlab中保存Kinect深度图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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