Open3D实现点云的平移、旋转、缩放

一、代码

Python

import open3d as o3d
import numpy as np


def rotate_pointcloud(pointcloud, degree, axis):
    radian = np.radians(degree)
    if axis == 0:
        restore = pointcloud.get_rotation_matrix_from_xyz((radian, 0, 0))
        pointcloud.rotate(restore, center=(0, 0, 0))
    elif axis == 1:
        restore = pointcloud.get_rotation_matrix_from_xyz((0, radian, 0))
        pointcloud.rotate(restore, center=(0, 0, 0))
    elif axis == 2:
        restore = pointcloud.get_rotation_matrix_from_xyz((0, 0, radian))
        pointcloud.rotate(restore, center=(0, 0, 0))
    return pointcloud


def translate_pointcloud(pointcloud, translate, axis):
    if axis == 0:
        pointc

猜你喜欢

转载自blog.csdn.net/qq_58060770/article/details/137871855