PCL中点云的变换——变换值的理解
Transformation of point cloud in PCL - understanding of transformation values
我从 here
下载了 standford bunny 的扫描件
有一个 conf 文件,其中包含扫描的转换,看起来像这样:
camera -0.0172 -0.0936 -0.734 -0.0461723 0.970603 -0.235889 0.0124573
bmesh bun000.ply 0 0 0 0 0 0 1
bmesh bun045.ply -0.0520211 -0.000383981 -0.0109223 0.00548449 -0.294635 -0.0038555 0.955586
我想做的是使用点云库将这 2 次扫描放到同一个坐标系中,但我不明白这些变换的值
我找到了关于 4x4 矩阵变换的教程,是否可以从这些值创建 4x4 矩阵?或者这是完全不同的东西?
我不确定我的答案,从格式来看我认为是 position_x position_y position_z quaternion_x quaternion_y quaternion_z quaternion_w
但请检查下面提供的代码
from transforms3d.quaternions import quat2mat
import numpy as np
# Create Identity transformation for 4x4
T = np.eye(4)
# Caution quat2mat uses w, x, y, z! Need to reorder your quaternion
T[:3, :3] = quat2mat([0.0124573, -0.0461723, 0.970603, -0.235889])
# Insert position x, y, z
T[:3, 3] = [-0.0172, -0.0936, -0.734]
# Print Result
print(T)
# [[-0.99542587 -0.08375279 0.04596522 -0.0172 ]
# [-0.09550694 0.8844491 -0.45675838 -0.0936 ]
# [-0.00239911 -0.45905911 -0.88840249 -0.734 ]
# [ 0. 0. 0. 1. ]]
我从 here
下载了 standford bunny 的扫描件有一个 conf 文件,其中包含扫描的转换,看起来像这样:
camera -0.0172 -0.0936 -0.734 -0.0461723 0.970603 -0.235889 0.0124573
bmesh bun000.ply 0 0 0 0 0 0 1
bmesh bun045.ply -0.0520211 -0.000383981 -0.0109223 0.00548449 -0.294635 -0.0038555 0.955586
我想做的是使用点云库将这 2 次扫描放到同一个坐标系中,但我不明白这些变换的值
我找到了关于 4x4 矩阵变换的教程,是否可以从这些值创建 4x4 矩阵?或者这是完全不同的东西?
我不确定我的答案,从格式来看我认为是 position_x position_y position_z quaternion_x quaternion_y quaternion_z quaternion_w
但请检查下面提供的代码
from transforms3d.quaternions import quat2mat
import numpy as np
# Create Identity transformation for 4x4
T = np.eye(4)
# Caution quat2mat uses w, x, y, z! Need to reorder your quaternion
T[:3, :3] = quat2mat([0.0124573, -0.0461723, 0.970603, -0.235889])
# Insert position x, y, z
T[:3, 3] = [-0.0172, -0.0936, -0.734]
# Print Result
print(T)
# [[-0.99542587 -0.08375279 0.04596522 -0.0172 ]
# [-0.09550694 0.8844491 -0.45675838 -0.0936 ]
# [-0.00239911 -0.45905911 -0.88840249 -0.734 ]
# [ 0. 0. 0. 1. ]]