资源简介
通过简单的编译操作即可在matlab 2016a以上的环境下调用kinectv2的完整功能,压缩文件内有具体说明。

代码片段和文件信息
% BODYDEMO Illustrates how to use the Kin2 object to get and draw the
% Skeleton data
%
% Juan R. Terven jrterven@hotmail.com
% Diana M. Cordova diana_mce@hotmail.com
%
% Citation:
% Terven Juan. Cordova-Esparza Diana “Kin2. A Kinect 2 Toolbox for MATLAB“ Science of
% Computer Programming 2016. DOI: http://dx.doi.org/10.1016/j.scico.2016.05.009
%
% https://github.com/jrterven/Kin2 2016.
addpath(‘Mex‘);
clear all
close all
% Create Kinect 2 object and initialize it
% Available sources: ‘color‘ ‘depth‘ ‘infrared‘ ‘body_index‘ ‘body‘
% ‘face‘ and ‘HDface‘
k2 = Kin2(‘color‘‘depth‘‘body‘);
% images sizes
d_width = 512; d_height = 424; outOfRange = 4000;
c_width = 1920; c_height = 1080;
% Color image is to big let‘s scale it down
COL_SCALE = 1.0;
% Create matrices for the images
depth = zeros(d_heightd_width‘uint16‘);
color = zeros(c_height*COL_SCALEc_width*COL_SCALE3‘uint8‘);
% depth stream figure
d.h = figure;
d.ax = axes;
d.im = imshow(zeros(d_heightd_width‘uint8‘));
%hold on;
title(‘Depth Source (press q to exit)‘)
set(gcf‘keypress‘‘k=get(gcf‘‘currentchar‘‘);‘); % listen keypress
% color stream figure
c.h = figure;
c.ax = axes;
c.im = imshow(color[]);
title(‘Color Source (press q to exit)‘);
set(gcf‘keypress‘‘k=get(gcf‘‘currentchar‘‘);‘); % listen keypress
%hold on
% Loop until pressing ‘q‘ on any figure
k=[];
disp(‘Press q on any figure to exit‘)
while true
% Get frames from Kinect and save them on underlying buffer
validData = k2.updateData;
% Before processing the data we need to make sure that a valid
% frame was acquired.
if validData
% Copy data to Matlab matrices
depth = k2.getDepth;
color = k2.getColor;
% update depth figure
depth8u = uint8(depth*(255/outOfRange));
depth8uc3 = repmat(depth8u[1 1 3]);
d.im = imshow(depth8uc3 ‘Parent‘ d.ax);
%set(d.im‘CData‘depth8uc3);
% update color figure
color = imresize(colorCOL_SCALE);
c.im = imshow(color ‘Parent‘ c.ax);
%set(c.im‘CData‘color);
% Get 3D bodies joints
% Input parameter can be ‘Quat‘ or ‘Euler‘ for the joints
% orientations.
% getBodies returns a structure array.
% The structure array (bodies) contains 6 bodies at most
% Each body has:
% -Position: 3x25 matrix containing the xyz of the 25 joints in
% camera space coordinates
% - Orientation:
% If input parameter is ‘Quat‘: 4x25 matrix containing the
% orientation of each joint in [x; y; z w]
% If input parameter is ‘Euler‘: 3x25 matrix containing the
% orientation of each joint in [Pitch; Yaw; Roll]
% -TrackingState: state of each joint. These can be:
% NotTracked=0 Inferred=1 or Tracked=2
% -LeftHandState: state of the left hand
% -RightHandState: state of the right hand
[bodies fcp timeStamp] = k2.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-07-05 18:26 jrterven-Kin2-afeec4f\
文件 378 2017-07-05 18:26 jrterven-Kin2-afeec4f\.gitattributes
文件 652 2017-07-05 18:26 jrterven-Kin2-afeec4f\.gitignore
文件 2577 2017-07-05 18:26 jrterven-Kin2-afeec4f\DemoAll.m
目录 0 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\
文件 13003 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2.h
文件 56159 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2.m
文件 11968 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2Collector.m
文件 21792 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2_ba
文件 12743 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2_face.cpp
文件 21378 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2_fusion.cpp
文件 14846 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2_mapping.cpp
文件 37234 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\Kin2_mex.cpp
文件 2332 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\calibCostFun.m
文件 1877 2017-07-05 18:26 jrterven-Kin2-afeec4f\Mex\class_handle.hpp
文件 2200 2017-07-05 18:26 jrterven-Kin2-afeec4f\README.txt
目录 0 2017-07-05 18:26 jrterven-Kin2-afeec4f\UserGuide\
文件 217941 2017-07-05 18:26 jrterven-Kin2-afeec4f\UserGuide\kin2-user-guide.pdf
文件 4623 2017-07-05 18:26 jrterven-Kin2-afeec4f\bodyDemo.m
文件 2503 2017-07-05 18:26 jrterven-Kin2-afeec4f\bodyIndexDemo.m
文件 4236 2017-07-05 18:26 jrterven-Kin2-afeec4f\calibrationDemo.m
文件 1627 2017-07-05 18:26 jrterven-Kin2-afeec4f\compile_cpp_files.m
文件 3055 2017-07-05 18:26 jrterven-Kin2-afeec4f\faceDemo.m
文件 3951 2017-07-05 18:26 jrterven-Kin2-afeec4f\faceHDDemo.m
文件 3221 2017-07-05 18:26 jrterven-Kin2-afeec4f\faceHDDemo2.m
文件 1167604 2017-07-05 18:26 jrterven-Kin2-afeec4f\image.png
文件 2970 2017-07-05 18:26 jrterven-Kin2-afeec4f\kinectFusionDemo.m
文件 5314 2017-07-05 18:26 jrterven-Kin2-afeec4f\mapping2CamDemo.m
文件 4965 2017-07-05 18:26 jrterven-Kin2-afeec4f\mappingDemo.m
文件 2322 2017-07-05 18:26 jrterven-Kin2-afeec4f\pointCloudDemo.m
文件 2757 2017-07-05 18:26 jrterven-Kin2-afeec4f\pointCloudDemo2.m
............此处省略2个文件信息
- 上一篇:matlab子空间聚类
- 下一篇:基于access的点菜系统
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论