点云从细长的环形转变为原始的圆形

问题描述 投票:0回答:1

我有一个用轮廓仪(激光)捕获的环点云,如下所示

我想改造它,让它恢复原来的圆形。我拥有的所有信息都是云的 XYZ 坐标。

我尝试了两种不同的方法,但都不起作用。

方法一:

x_min = 0
x_max = 360
D = 1
        
x_coordinates = xyz[:, 1]
y_coordinates = xyz[:, 0]
z_coordinates = xyz[:, 2]
theta = (x_coordinates - x_min)/(x_max - x_min)*2*np.radians(180)
gamma = D - y_coordinates
x_round = gamma * np.cos(theta)
y_round = gamma * np.sin(theta)
z_round = z_coordinates
        
assert x_round.ndim == 1 and y_round.ndim == 1 and z_round.ndim == 1, "Arrays must be 1-dimensional"
points = np.stack((x_round, y_round, z_round), axis=-1)  # Stack arrays along a new axis to get Nx3
        
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
o3d.visualization.draw_geometries([pcd], window_name="Original Shape")

方法二:

def cart2sph(x, y, z):
   xy = np.sqrt(x**2 + y**2) # sqrt(x² + y²)
   x_2 = x**2
   y_2 = y**2
   z_2 = z**2
   r = np.sqrt(x_2 + y_2 + z_2) # r = sqrt(x² + y² + z²)
   theta = np.arctan2(y, x) 
   phi = np.arctan2(xy, z) 
   return r, theta, phi
computer-vision point-clouds open3d
1个回答
0
投票

从概念上讲,每对 (X,Y,Z) 都与获取它的扫描仪的位姿、相对于某个全局坐标系的旋转和平移 (R, t) 相关联 - 例如,第一个坐标系扫描。根据设备的不同,每个姿势都会获取整组点(“补丁”、“条带”、“线”)。然后,通过应用关联的设备旋转和平移将每个集合转换为全局框架。

如果设备的校准/姿态跟踪足够好(即与点测量一样准确),那就足够了。不过,扫描仪通常比姿势跟踪器更准确,其结果是点集在转换为全局框架后不会完全对齐。在这种情况下,可以使用数据本身和一些约束来细化对齐 - 使用共同属于“迭代最近点”范畴的算法。

© www.soinside.com 2019 - 2024. All rights reserved.