【问题标题】:rotate a pointcloud in z axis沿 z 轴旋转点云
【发布时间】:2021-01-07 03:09:58
【问题描述】:

我正在尝试旋转 pcd,但出现以下错误,我该如何解决 -

import open3d as o3d 
import numpy as np 

xyz = o3d.io.read_point_cloud("data.pcd")
xyz = xyz.rotate(xyz.get_rotation_matrix_from_xyz((0.7 * np.pi, 0, 0.6 * np.pi)),center=True)

错误 -

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: get_rotation_matrix_from_xyz(): incompatible function arguments. The following argument types are supported:
    1. (rotation: numpy.ndarray[float64[3, 1]]) -> numpy.ndarray[float64[3, 3]]

Invoked with: array([[-0.30901699, -0.95105652,  0.        ],
       [-0.55901699,  0.18163563, -0.80901699],
       [ 0.76942088, -0.25      , -0.58778525]]); kwargs: center=True

我该如何解决这个问题

【问题讨论】:

    标签: point-cloud-library open3d


    【解决方案1】:

    center 参数不是布尔值,但应该描述旋转中心(参见docs):

    center (numpy.ndarray[float64[3, 1]]) - 用于变换的旋转中心

    这将围绕原点 (0,0,0) 旋转:

    import open3d as o3d 
    import numpy as np 
    
    xyz = o3d.io.read_point_cloud("data.pcd")
    R = xyz.get_rotation_matrix_from_xyz((0.7 * np.pi, 0, 0.6 * np.pi))
    xyz = xyz.rotate(R, center=(0,0,0))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-29
      • 1970-01-01
      • 2018-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-26
      • 1970-01-01
      相关资源
      最近更新 更多