通过简单的编译操作即可在matlab 2016a以上的环境下调用kinectv2的完整功能,压缩文件内有具体说明。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 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-afeec4fDemoAll.m
目录 0 2017-07-05 18:26 jrterven-Kin2-afeec4fMex
文件 13003 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2.h
文件 56159 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2.m
文件 11968 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2Collector.m
文件 21792 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_base.cpp
文件 12743 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_face.cpp
文件 21378 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_fusion.cpp
文件 14846 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_mapping.cpp
文件 37234 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_mex.cpp
文件 2332 2017-07-05 18:26 jrterven-Kin2-afeec4fMexcalibCostFun.m
文件 1877 2017-07-05 18:26 jrterven-Kin2-afeec4fMexclass_handle.hpp
文件 2200 2017-07-05 18:26 jrterven-Kin2-afeec4fREADME.txt
目录 0 2017-07-05 18:26 jrterven-Kin2-afeec4fUserGuide
文件 217941 2017-07-05 18:26 jrterven-Kin2-afeec4fUserGuidekin2-user-guide.pdf
文件 4623 2017-07-05 18:26 jrterven-Kin2-afeec4fodyDemo.m
文件 2503 2017-07-05 18:26 jrterven-Kin2-afeec4fodyIndexDemo.m
文件 4236 2017-07-05 18:26 jrterven-Kin2-afeec4fcalibrationDemo.m
文件 1627 2017-07-05 18:26 jrterven-Kin2-afeec4fcompile_cpp_files.m
文件 3055 2017-07-05 18:26 jrterven-Kin2-afeec4ffaceDemo.m
文件 3951 2017-07-05 18:26 jrterven-Kin2-afeec4ffaceHDDemo.m
文件 3221 2017-07-05 18:26 jrterven-Kin2-afeec4ffaceHDDemo2.m
文件 1167604 2017-07-05 18:26 jrterven-Kin2-afeec4fimage.png
文件 2970 2017-07-05 18:26 jrterven-Kin2-afeec4fkinectFusionDemo.m
文件 5314 2017-07-05 18:26 jrterven-Kin2-afeec4fmapping2CamDemo.m
文件 4965 2017-07-05 18:26 jrterven-Kin2-afeec4fmappingDemo.m
文件 2322 2017-07-05 18:26 jrterven-Kin2-afeec4fpointCloudDemo.m
文件 2757 2017-07-05 18:26 jrterven-Kin2-afeec4fpointCloudDemo2.m
............此处省略2个文件信息
% 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-afeec4fDemoAll.m
目录 0 2017-07-05 18:26 jrterven-Kin2-afeec4fMex
文件 13003 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2.h
文件 56159 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2.m
文件 11968 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2Collector.m
文件 21792 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_ba
文件 12743 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_face.cpp
文件 21378 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_fusion.cpp
文件 14846 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_mapping.cpp
文件 37234 2017-07-05 18:26 jrterven-Kin2-afeec4fMexKin2_mex.cpp
文件 2332 2017-07-05 18:26 jrterven-Kin2-afeec4fMexcalibCostFun.m
文件 1877 2017-07-05 18:26 jrterven-Kin2-afeec4fMexclass_handle.hpp
文件 2200 2017-07-05 18:26 jrterven-Kin2-afeec4fREADME.txt
目录 0 2017-07-05 18:26 jrterven-Kin2-afeec4fUserGuide
文件 217941 2017-07-05 18:26 jrterven-Kin2-afeec4fUserGuidekin2-user-guide.pdf
文件 4623 2017-07-05 18:26 jrterven-Kin2-afeec4fodyDemo.m
文件 2503 2017-07-05 18:26 jrterven-Kin2-afeec4fodyIndexDemo.m
文件 4236 2017-07-05 18:26 jrterven-Kin2-afeec4fcalibrationDemo.m
文件 1627 2017-07-05 18:26 jrterven-Kin2-afeec4fcompile_cpp_files.m
文件 3055 2017-07-05 18:26 jrterven-Kin2-afeec4ffaceDemo.m
文件 3951 2017-07-05 18:26 jrterven-Kin2-afeec4ffaceHDDemo.m
文件 3221 2017-07-05 18:26 jrterven-Kin2-afeec4ffaceHDDemo2.m
文件 1167604 2017-07-05 18:26 jrterven-Kin2-afeec4fimage.png
文件 2970 2017-07-05 18:26 jrterven-Kin2-afeec4fkinectFusionDemo.m
文件 5314 2017-07-05 18:26 jrterven-Kin2-afeec4fmapping2CamDemo.m
文件 4965 2017-07-05 18:26 jrterven-Kin2-afeec4fmappingDemo.m
文件 2322 2017-07-05 18:26 jrterven-Kin2-afeec4fpointCloudDemo.m
文件 2757 2017-07-05 18:26 jrterven-Kin2-afeec4fpointCloudDemo2.m
............此处省略2个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)