主要内容

从Kinect为Windows的绘图彩色点云

此示例显示如何使用Windows V2的Kinect绘制颜色点云。

运行此示例的要求

1. MATLAB,图像采集工具箱和计算机视觉系统工具箱。

2. Windows V2传感器的Kinect。

3.最小PC配置:Windows 8 64位。

为Kinect V2设备创建系统对象

colordevice = imaq.videodevice('kinect',1)深度device = imaq.videodevice('kinect'2)
colordevice = imaq.videodevice with属性:设备:'Kinect Color Sensor(Kinect-1)'Videoformat:'RGB_640x480'ROI:[1 1 640 480] reshorcorspace:'RGB'返回Datype:'uint8'deviceproperties:[1x1 imaq.internal。DeviceProperties] depthDevice = imaq.VideoDevice with properties: Device: 'Kinect Depth Sensor (kinect-2)' VideoFormat: 'Depth_640x480' ROI: [1 1 640 480] ReturnedColorSpace: 'grayscale' ReturnedDataType: 'uint16' DeviceProperties: [1x1 imaq.internal.DeviceProperties]

初始化摄像机

colordevice();深度();

从设备上抓取一帧

Colorimage = Colordevice();DemageImage = DepthDevice();

提取点云

深度必须是Kinect深度视频输出对象或Kinect深度imaq.videodevice对象。

DemageImage必须是UINT16。Colorimage必须是UINT8。

ptcloud = pcfrom金(深度,深度,colorimage);%初始化播放器以可视化3-D点云数据。轴是%设置适当设置,以从Kinect可视化点云。player = pcplayer(ptcloud.xlimits,ptcloud.ylimits,ptcloud.zlimits,......'verticalaxis''是''verticalaxisdir''下');xlabel(player.axes,'x(m)');ylabel(player.axes,'y(m)');zlabel(player.axes,'z(m)');%获取并查看Kinect Point云数据。尽管Isopen(播放器)ColorImage = Colordevice();DemageImage = DepthDevice();ptcloud = pcfrom金(深度,深度,colorimage);查看(播放器,Ptcloud);结尾

释放设备

发布(Colordevice);释放(深度);

更多关于Kinect Point云

- 右手世界坐标系的起源位于相机的中心。坐标系的X轴指向右侧,Y轴指向向下,Z轴指向远离相机。

- 由于Kinect深度摄像机的范围有限,因此深度图像中的一些像素没有相应的3-D坐标。这些像素的值在PtCloud的位置属性中设置为NaN。

- 由于Kinect设计用于游戏,原始图像,Colorimage和DepresImage,来自Kinect是现场的镜像。纠正返回的点云以匹配实际场景。