2016-04-27 146 views

回答

0

不错的问题。 您应该使用来自Burrus的本教程 - 基本上,您需要使用深度信息将颜色/深度质心转换为第三维。请注意,Kinect v1深度和颜色流稍有不匹配,因此也要考虑到这一点。

教程可以在这里找到:http://nicolas.burrus.name/index.php/Research/KinectCalibration 您也可以使用该作者的作品:Khoshelham,K.,& Elberink,SO(2012) - Kinect的深度数据的准确性和分辨率为室内地图应用

该matlab代码应该是这样的:

% All formulas and values from: 
% Khoshelham, K., & Elberink, S. O. (2012). 
% Accuracy and resolution of Kinect depth data for indoor mapping applications. 
% Sensors (Basel, Switzerland), 12(2), 1437–54. doi:10.3390/s120201437 

load('janFrameThousand.mat') 
pc=zeros([size(D) 3]); 
W=size(D,2); 
H=size(D,1); 
f=5.453; 
for indWidth = 1:W 
    for indHeight= 1:H 
     % copy z value 
     pc(indHeight,indWidth,3)=D(indHeight,indWidth); 
     % calc x value 
     pc(indHeight,indWidth,1)=-(pc(indHeight,indWidth,3)/f)*... 
      ((indWidth-W/2)*0.0093+0.063); 
     % calc y value 
     pc(indHeight,indWidth,2)=-(pc(indHeight,indWidth,3)/f)*... 
      ((indHeight-H/2)*0.0093+0.039); 
    end 
end 
X=pc(:,:,1); 
% X=X(:); 
Y=pc(:,:,2); 
% Y=Y(:); 
Z=-pc(:,:,3); 
Z(Z==0)=NaN; 

Surface=surf(X,Y,Z,'edgecolor','none','facecolor','interp'); 
lighting gouraud 
camlight 
% colormap(repmat(winter,20,1)) 
axis image 
axis vis3d 
xlabel('X axis') 
ylabel('Y axis') 
zlabel('Z axis') 
+0

读完这篇论文之后,我仍然困惑不解,所以我收集了一些关于你的问题。你为什么取f = 5.453?这些是你自己的校准值吗? 0.063和0.039是delta x和y? 0.0093代表什么?从我记忆中的 – havakok

+0

中可以看出,它们与Kinect v1的内在参数有关。 – 16per9