关于使用open3d进行点云一系列操作的一些方法python
- rgb+depth =pcl
import open3d as o3d
import os
import pcl
color = '1.jpg'
depth = '1.png'
color_raw = o3d.io.read_image(color)
depth_raw = o3d.io.read_image(depth)
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(color_raw, depth_raw)
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd_image,o3d.camera.PinholeCameraIntrinsic(o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault))
pcd.transform([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]])#齐次相机内参数矩阵
o3d.io.write_point_cloud("1.ply", pcd)
- 保存为.pcd格式(format --ascii)
(只需要加上 write_ascii=True就可以了)
o3d.io.write_point_cloud("1.pcd", pcd, write_ascii=True)
- open3d还可以保存为以下格式
文章评论