I have a numpy array which is the color image "img" of shape (height, width, 3), and also a depth numpy array of shape (height, width). And I want to create an RGBD image and display it, for which I'm doing the following:
o3d.geometry.RGBDImage.create_from_color_and_depth(img, depth)
But I'm getting the error:
TypeError: create_from_color_and_depth(): incompatible function arguments. The following argument types are supported:
1. (color: open3d.open3d_pybind.geometry.Image, depth: open3d.open3d_pybind.geometry.Image, depth_scale: float = 1000.0, depth_trunc: float = 3.0, convert_rgb_to_intensity: bool = True) -> open3d.open3d_pybind.geometry.RGBDImage
How to fix this? If it requires an Image type, then how to convert the numpy array to an Image type?
Even when I pass in the numpy arrays into the o3d.geometry.Image constructors like so:
o3d.geometry.RGBDImage.create_from_color_and_depth(o3d.geometry.Image(img), o3d.geometry.Image(depth))
I get the error:
TypeError: create_from_color_and_depth(): incompatible function arguments. The following argument types are supported:
1. (color: open3d.open3d_pybind.geometry.Image, depth: open3d.open3d_pybind.geometry.Image, depth_scale: float = 1000.0, depth_trunc: float = 3.0, convert_rgb_to_intensity: bool = True) -> open3d.open3d_pybind.geometry.RGBDImage
How to fix this and create the RGBD image from the rgb numpy array and the depth numpy array?