资源简介
通过简单的编译操作即可在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子空间聚类
- 图像去除干扰条纹
- 模糊车牌识别
- MATLAB程序设计与应用(刘卫国编)课
- 高光谱图像在matlab里的读入与显示
- matlab-bgl 4.0.1
- MATLAB聚类分析工具箱
- matlab robotics toolbox
- SVM算法对MNIST数据集分类
- 鱼雷控制系统计算机辅助分析设计与
- 抗干扰仿真 matlab 源码
- 信号与系统大作业 声音信号的频谱分
- matlab 蒙特卡罗
- LBF和LDF模型的matlab程序,用于图像分
- surf的matlab实现
- c均值聚类matlab算法和程序
- 图像加密算法实现 matlab
- PSAT-2.1.10最新版
- GPS信号捕获跟踪的MATLAB仿真,里面有
- 编写MATLAB函数 图像处理实验报告
- 基于MATLAB的OFDM通信系统模型的仿真毕
- 1维严格耦合波分析matlab程序
- Vibe算法,亲测可用,可用于视频前景
- Vibe背景建模的方法检测运动物体mat
-
Matlab_Simuli
nk环境下无人机全过程飞 - 基于MATLAB的BP神经网络应用绝对好资源
- 关于变声变调的matlab设计 比较详细
- 语音信号子带编码matlab程序subband_co
- MATLAB contourlet工具箱
- 贝叶斯网络工具箱MATLAB工具箱
评论
共有 条评论