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

project_pcd to_rgbd_image, empty depth and rgb image #6916

Open
3 tasks done
kisaragychihaya opened this issue Aug 13, 2024 · 1 comment
Open
3 tasks done

project_pcd to_rgbd_image, empty depth and rgb image #6916

kisaragychihaya opened this issue Aug 13, 2024 · 1 comment
Labels
bug Not a build issue, this is likely a bug.

Comments

@kisaragychihaya
Copy link

Checklist

Describe the issue

I try to use the project_to_rgbd_image function on my own point cloud like in https://www.open3d.org/docs/release/python_example/geometry/point_cloud/index.html#point-cloud-to-rgbd-py . But got a depth img with all zero value
src+data.zip

Steps to reproduce the bug

import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt
print(o3d.__version__)

if __name__ == '__main__':
    # 1. read depth and color image
    pcd = o3d.t.io.read_point_cloud("1.ply")
    h=1080
    w=1920
    f=500
    intr = o3d.open3d.camera.PinholeCameraIntrinsic(w, h, fx=f, fy=f, cx=w/2, cy=h/2)
    rgbd_reproj =  pcd.project_to_rgbd_image(w,
                                            h,
                                            intr.intrinsic_matrix,
                                            depth_scale=1,
                                            depth_max=500.0,)
    print(np.max(rgbd_reproj.depth))
    plt.subplot(1, 2, 1)
    plt.title('chair grayscale image')
    plt.imshow(rgbd_reproj.color)
    plt.subplot(1, 2, 2)
    plt.title('chair depth image')
    plt.imshow(rgbd_reproj.depth)
    plt.show()

Error message

C:\Users\yiku\miniconda3\envs\hgnetv2-deeplabv3\python.exe "C:\Users\yiku\Documents\WeChat Files\wxid_1na96tsg783o21\FileStorage\File\2024-08\新建文件夹\test.py"
0.18.0
0.0
image

Expected behavior

No response

Open3D, Python and System information

- Operating system:  Windows 10 64-bit
- Python version: 3.9.19 (main, Mar 21 2024, 17:21:27) [MSC v.1916 64 bit (AMD64)]
- Open3D version: output from python: 0.18.0
- System architecture: x86 
- Is this a remote workstation?:  no
- How did you install Open3D?: pip
- Compiler version (if built from source):

Additional information

No response

@kisaragychihaya kisaragychihaya added the bug Not a build issue, this is likely a bug. label Aug 13, 2024
@nicolaloi
Copy link
Contributor

The points of your point cloud are too far away, you have to increase the depth_max argument of project_to_rgbd_image. With a value of 2000 instead of 500 you can already visualize it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not a build issue, this is likely a bug.
Projects
None yet
Development

No branches or pull requests

2 participants