内容
阿维(Avi)的一周选择是硬件支持包金宝app
对于Windows运行时Kinect的图像采集工具箱金宝app支持包, 经过
The Image Acquisition Toolbox Team。使您能够acqu硬件支持包金宝appire RGB, depth images, and 3-D point clouds from a Kinect v2 sensor. If you have a Kinect for Windows v2 you can start using it in MATLAB by downloading the hardware support package from File Exchange.
在MATLAB中使用Kinect进行Windows V2
Sucsesfuly安装了硬件支持软件包后,您可以通过定义iMaq.videDodeVice S金宝appystem对象连接到设备。请记住Kinect V2返回RGB和深度图像,因此我们为每个图像创建一个系统对象
colordevice = imaq.videodevice('kinect',,,,1) depthDevice = imaq.VideoDevice('kinect',,,,2)
colorDevice = imaq.VideoDevice with properties: Device: 'Kinect V2 Color Sensor (kinect-1)' VideoFormat: 'BGR_1920x1080' ROI: [1 1 1920 1080] ReturnedColorSpace: 'rgb' ReturnedDataType: 'uint8' DeviceProperties: [1x1 imaq.internal.DeviceProperties] depthDevice = imaq.VideoDevice with properties: Device: 'Kinect V2 Depth Sensor (kinect-2)' VideoFormat: 'Depth_512x424' ROI: [1 1 512 424] ReturnedColorSpace: 'grayscale' ReturnedDataType: 'uint16' DeviceProperties: [1x1 imaq.internal.DeviceProperties]
初始化设备
Now lets initialize the device and grab an input RGB image and a depth image.
步骤(Colordevice);step(depthDevice);colyImage = step(colordevice);depthimage = step(depthdevice);
从设备获取3-D点云
由于传感器具有颜色和深度信息,因此您可以将两个传感器的信息组合在一起,以创建一个3-D点云。
ptcloud = pcfromkinect(Depthdevice,Depthimage,Lolilimage);
从Kinect V2查看点云流
让我们初始化PCPLAYER,使我们可以可视化3-D点云的实时流。我们首先初始化玩家。
player = pcplayer(ptcloud.xlimits,ptcloud.ylimits,ptcloud.zlimits,...'VerticalAxis',,,,'y',,,,'垂直线索',,,,'down');xlabel(player.Axes,'X (m)');ylabel(player.axes,'Y (m)');zlabel(player.Axes,'z(m)');为了i = 1:500 colorimage = step(colordevice);depthimage = step(depthdevice);ptcloud = pcfromkinect(Depthdevice,Depthimage,Lolilimage);查看(播放器,ptcloud);结尾
检测3-D点云中的平面
Once we have aquired a 3-D point cloud from the Kinect v2 we can process it using functionality in the Computer Vision System Toolbox. Here I simply extract and display planes in the 3-D point cloud.
colyImage = step(colordevice);depthimage = step(depthdevice);ptcloud = pcfromkinect(Depthdevice,Depthimage,Lolilimage);maxDistance = 0.02; referenceVector = [0,0,1]; maxAngularDistance = 5; [model,inlierIndices,outlierIndices] = pcfitplane(ptCloud,maxDistance,referenceVector,maxAngularDistance); figure; pcshow(ptCloud); holdon;图(模型)
释放设备
当你们都是时,不要忘记释放设备。
release(colorDevice); release(depthDevice);
Comments
要发表评论,请单击here登录您的数学帐户或创建一个新帐户。