文件交换的选择

我们最好的用户提交

硬件支持的图像取得金宝appKinect v2

内容

本周Avi的选择是一个硬件支持包金宝app图像采集的工具箱支持包Kinect为Windows运金宝app行时,通过图像采集工具箱团队。硬件支持方案使您能够获得R金宝appGB,深度图像和三维点云的Kinect v2传感器。如果你有一个Kinect为Windows v2可以开始使用MATLAB的下载文件交换的硬件支持包。金宝app

在MATLAB中使用Kinect为Windows v2

一旦你安装了sucessfuly硬件支持包你可以通过定义一个imaq连接到设备。金宝appVideoDevice系统对象。记得Kinect v2返回图像RGB和深度,所以我们创建一个系统对象
colorDevice = imaq.VideoDevice (“kinect”1)depthDevice = imaq.VideoDevice (“kinect”,2)
colorDevice = imaq。视频Device 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]

初始化设备

现在允许初始化设备和抓住一个输入RGB图像和深度图像。
步骤(colorDevice);%初始化/ RGB颜色传感器步骤(depthDevice);%初始化深度传感器colorImage =步骤(colorDevice);%加载一个颜色/ RGB框架depthImage =步骤(depthDevice);%加载一个深度框架

从设备获取三维点云

因为传感器的颜色和深度信息您可以结合两种传感器的信息创建一个三维点云。
ptCloud = pcfromkinect (depthDevice depthImage colorImage);

看的点云流Kinect v2

允许初始化pcplayer将让我们想象一个直播的三维点云。我们第一次初始化的球员。
球员= pcplayer (ptCloud.XLimits ptCloud.YLimits ptCloud.ZLimits,“VerticalAxis”,“y”,“VerticalAxisDir”,“下来”);包含(player.Axes“X (m)”);ylabel (player.Axes“Y (m)”);zlabel (player.Axes“Z (m)”);%然后流实时三维点云的Kinect v2。我= 1:50 0 colorImage = (colorDevice);depthImage =步骤(depthDevice);ptCloud = pcfromkinect (depthDevice depthImage colorImage);视图(球员,ptCloud);结束Kinect_POTW_Post_01

检测飞机的三维点云

一旦我们有增大的3 d点云Kinect v2我们可以处理它在计算机视觉系统工具箱使用功能。这里我简单地提取和显示飞机的三维点云。
colorImage =步骤(colorDevice);depthImage =步骤(depthDevice);ptCloud = pcfromkinect (depthDevice depthImage colorImage);%获取一个新的点云maxDistance = 0.02;referenceVector = [0, 0, 1];maxAngularDistance = 5;(模型、inlierIndices outlierIndices) = pcfitplane (ptCloud、maxDistance referenceVector, maxAngularDistance);图;pcshow (ptCloud);持有;情节(模型)Kinect_POTW_Post_02

释放装置

当你都多恩别忘了释放装置。
释放(colorDevice);释放(depthDevice);
|
  • 打印

评论

留下你的评论,请点击在这里MathWorks账户登录或创建一个新的。