Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

From NUMPY RGBD To o3d.RGBD

Open wangmiaowei opened this issue 3 years ago • 1 comments

Checklist

My Question

RuntimeError: [Open3D Error] (static std::shared_ptropen3d::geometry::RGBDImage open3d::geometry::RGBDImage::CreateFromColorAndDepth(const open3d::geometry::Image&, const open3d::geometry::Image&, double, double, bool)) /root/Open3D/cpp/open3d/geometry/RGBDImageFactory.cpp:42: [CreateFromColorAndDepth] Unsupported image format.

    radius_normal = voxel_size * 2
    color_raw = Image.open(path+"/color/0000"+str(i)+".jpg")
    depth_raw = Image.open(path+"/depth/0000"+str(i)+".png")
    color  =255*rgb_transform(color_raw)
    depth = dep_transform(np.asarray(depth_raw),dims)
    color_o3d = o3d.geometry.Image(color.detach().numpy().astype(np.uint8))
    depth_o3d = o3d.geometry.Image((depth.detach().numpy()).astype(np.uint16))
    print('color_o3d.shape: ',(np.asarray(color_o3d)).max())
    rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(color_o3d,depth_o3d)
    pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd_image, pinhole_camera_intrinsic)

wangmiaowei avatar Aug 18 '22 14:08 wangmiaowei

OK,this problem is solved by myself. I'd want to paste the solution! All the problems come from unsupported formats.The map type and shaped should be converted to the following format: Screenshot from 2022-08-19 11-15-13

wangmiaowei avatar Aug 19 '22 03:08 wangmiaowei