0

我正在尝试旋转 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

我该如何解决

4

1 回答 1

1

center参数不是布尔值,但应该描述旋转中心(请参阅文档):

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))
于 2021-01-06T19:09:58.023 回答