尝试使用Kinect在Python和libfreenect中拍摄的图像生成点云,但无法将深度数据与Kinect中拍摄的RGB数据对齐。
cx_d=3.3930780975300314e 02
cy_d=2.4273913761751615e 02
fx_d=5.9421434211923247e 02
fy_d=5.9104053696870778e 02
fx_rgb=5.2921508098293293e 02
fy_rgb=5.2556393630057437e 02
cx_rgb=3.2894272028759258e 02
cy_rgb=2.6748068171871557e 02
RR=NP.Array([
[0.999985794494467,- 0.00342913855773,0.00408066391266 ],
[0.00342037768765、0.999991835033557、0.002151948451469],
[-0.004088009930192,- 0.002137960469802,0.999989358593300 ]
] )
TT=NP.array (1.9985242312092553 e-02,-7.4423738761617583e-04,-1.0916736334336222e-02 ] ) )
# dddhf,vv are indices in depth image
defDepth_to_XYZ_and_RGB(DDDHF,vv ) :
# get z value in meters
pcz=depthLookUp[depths[vv,dddhf]]
# compute x,y values in meters
PCX=(DDDHF-CX_d ) * pcz/fx_d
pcy=(vv-cy_d ) * pcz/fy_d
#应用扩展校准
P3D=NP.Array([pcx,pcy,pcz] )。
P3DP=NP.dot(RR,P3D )- TT
# rgb indexes that P3D should match
ddh FP=p3dp [0] * FX _ RGB/p3dp [2] CX _ RGB
VP=p3dp [1] * fy _ RGB/p3dp [2] cy _ RGB
# returnapointinpointcloudanditscorrespondingcolorindices
return P3D,dddhfp,vvp
你做错了什么吗? 什么援助都称赞