You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何基于MATLAB标定参数实现LiDAR点云到相机的正确投影?

3D LiDAR到相机投影结果与MATLAB不符的问题排查

我在项目中开展3D LiDAR到相机的投影工作,采用MATLAB LiDAR-Camera模块完成标定,得到旋转矩阵(R)、平移矩阵(T)和相机内参矩阵(M)。使用MATLAB工具进行投影可得到正确结果,但采用文献给出的投影矩阵公式[M 0] × [[R T],[0 1]]将齐次坐标[x y z 1]转换为[u v w]时,投影结果与MATLAB输出不符,现寻求帮助排查代码错误,实现与MATLAB一致的投影效果。

MATLAB计算得到的标定参数

M = array([[904.4679,   0.    , 596.9176],
       [  0.    , 814.7088, 349.8212],
       [  0.    ,   0.    ,   1.    ]])

R = array([[ 0.124 , -0.0038,  0.9923],
       [-0.9912,  0.0474,  0.124 ],
       [-0.0475, -0.9989,  0.0021]])

T = array([[-0.56  ,  0.241 , -0.4454]])

自行编写的Python代码片段

rotation = np.array([[0.1240,-0.0038,0.9923],                                                       [-0.9912,0.0474,0.1240],[-0.0475,-0.9989,0.0021]])
traslation = np.array([[-0.5600,0.2410,-0.4454]])
traslation_1 = np.array([[-0.4454,0.2410,-0.5600]])
intrinsic = np.array([[904.4679,0,596.9176],[0,814.7088,349.8212],[0,0,1]])

a = np.concatenate((rotation,np.array([[0,0,0]])), axis =0)
b = np.concatenate((traslation_1.T, np.array([[1]])), axis =0)
c = np.concatenate((a,b), axis =1)

print('\n Extrinsic:\n \n',c)
d = np.concatenate((intrinsic, np.array([[0,0,0]]).T), axis =1)
print('\n Intrinsic:\n \n',d)
e = np.matmul(d,c)
print("\n Final:\n \n", e)
df = pd.read_csv('out_file.csv')

img = cv2.imread('images/0001.png')
v1_max = 0
v2_max = 0
uv = []
import matplotlib.pyplot as plt 
 
for i in range(df.shape[0]):
    point = np.array([[df['x'].iloc[i],df['y'].iloc[i],df['z'].iloc[i],1]]).T
    v = np.matmul(e, point)
    v = v/v[2]
    if v[0]<=720 and v[0] > 0  and v[1] < 1280 and v[1] > 0:
        img[int(np.floor(v[0])),int(np.floor(v[1]))] = [0,255,255] 
            
                       

cv2.imwrite('file.png', img) 

硬件配置

  • Velodyne 64通道LiDAR(10Hz)
  • 相机:1280*720单目相机
  • 标定棋盘格:10*7,图案尺寸10cm,带留白

内容的提问来源于stack exchange,提问作者harshal Verma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 13:20:30