Spaces:
Runtime error
Runtime error
jens
commited on
Commit
·
4b43677
1
Parent(s):
a979122
fix
Browse files
utils.py
CHANGED
@@ -92,8 +92,10 @@ def create_3d_pc(rgb_image, depth_image, depth=10):
|
|
92 |
|
93 |
|
94 |
def point_cloud(rgb_image, depth_image):
|
95 |
-
# Step 2: Create an RGBD image from the RGB and depth
|
96 |
-
|
|
|
|
|
97 |
# Step 3: Create a PointCloud from the RGBD image
|
98 |
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd_image, o3d.camera.PinholeCameraIntrinsic(o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault))
|
99 |
# Step 4: Convert PointCloud data to a NumPy array
|
|
|
92 |
|
93 |
|
94 |
def point_cloud(rgb_image, depth_image):
|
95 |
+
# Step 2: Create an RGBD image from the RGB and depth image
|
96 |
+
depth_o3d = o3d.geometry.Image(depth_image)
|
97 |
+
image_o3d = o3d.geometry.Image(rgb_image)
|
98 |
+
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(image_o3d, depth_o3d, convert_rgb_to_intensity=False)
|
99 |
# Step 3: Create a PointCloud from the RGBD image
|
100 |
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd_image, o3d.camera.PinholeCameraIntrinsic(o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault))
|
101 |
# Step 4: Convert PointCloud data to a NumPy array
|