Created
April 16, 2023 16:07
-
-
Save n1ckfg/889ba461fc44c2a409217846fc9c8702 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import open3d as o3d | |
| rgb = o3d.io.read_image("rgb_image.jpg") | |
| depth = o3d.io.read_image("depth_image.png") | |
| #intrinsics = o3d.io.read_pinhole_camera_intrinsic("intrinsics.json") | |
| intrinsics = o3d.camera.PinholeCameraIntrinsic(640, 480, fx=525.0, fy=525.0, cx=319.5, cy=239.5) | |
| rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(rgb, depth) | |
| pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd, intrinsics) | |
| o3d.io.write_point_cloud("output.ply", pcd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment