Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot use 'create_rgbd_image_from_color_and_depth' 'create_point_cloud_from_rgbd_image' after version update #1176

Closed
kaixin-bai opened this issue Sep 13, 2019 · 5 comments
Labels

Comments

@kaixin-bai
Copy link

code is below, after i update open3d to version 0.8.0.0, i got error like this:

rgbd = o3d.geometry.create_rgbd_image_from_color_and_depth(img, depth)
AttributeError: module 'open3d.open3d.geometry' has no attribute 'create_rgbd_image_from_color_and_depth'
image = np.array(img.copy())
H, W, _ = image.shape
fx, fy, cx, cy = get_intrinsic()
intrinsic = o3d.camera.PinholeCameraIntrinsic(W,H,fx,fy,cx,cy)
img = o3d.geometry.Image(image.astype(np.uint8))
depth = np.asarray(depth).astype(np.float32) / cam_scale
depth = o3d.geometry.Image(depth)
rgbd = o3d.geometry.create_rgbd_image_from_color_and_depth(img, depth)
pcd = o3d.geometry.create_point_cloud_from_rgbd_image(rgbd, intrinsic)

Could someone tell me how to fix it?
Thanks a lot!

@griegler
Copy link
Contributor

The API changed in 0.8.
The last two lines should be something like

rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(img, depth)
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd, intrinsic)

@rtuchman
Copy link

rtuchman commented Feb 2, 2020

Hi @griegler , what are the required types and shapes of img, depth?

Thanks

@griegler
Copy link
Contributor

griegler commented Feb 3, 2020

@rtuchman img and depth should have the same height and width. img can have one, or three channels, depth should have a single channel. img can be uint8, or float. depth should be float.

@sharoseali
Copy link

The API changed in 0.8. The last two lines should be something like

rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(img, depth)
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd, intrinsic)

Thanks, @griegler the resultant point cloud isn't well-drawn well and point cloud colours are also in grayscale not RGB. Any idea how to plot PFM correctly with the colour point cloud. THanks

@tanqiao-nreal
Copy link

tanqiao-nreal commented May 22, 2023

You need to set convert_rgb_to_intensity to False when calling create_from_color_and_depth to generate a color point cloud. See http://www.open3d.org/docs/0.7.0/python_api/open3d.geometry.create_rgbd_image_from_color_and_depth.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants