赞
踩
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)
o3d.io.write_point_cloud("1.pcd", pcd, write_ascii=True)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。