-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
How to create pointcloud from depth image correctly in open3d? #12090
Comments
Hi @thve25 The RealSense SDK has a range of post-processing filters that can be applied in pyrealsense2 by adding code to the script. Would any of these filters be able to provide the results that you were aiming for with custom post-processing in your Open3D script and therefore avoid the need to use Open3D? https://dev.intelrealsense.com/docs/post-processing-filters If you would prefer to use Open3D then the code shared by a RealSense user at isl-org/Open3D#473 (comment) for generating a real-time RealSense pointcloud in Open3D may be a helpful reference that you can compare to your own script. |
Yes, that would be ideal. However, for my case I want to remove 20% of pixels of the depth map and replace them by the average of the surrounding pixels. What I have found this far, is that its not possible to modify pixels in the pyrealsense depth frame.
Yes, in isl-org/Open3D#473 (comment) he does something similar as me, but the my pointclouds do not match for some reason. |
I've solved it. I used the wrong intrinsics. This is correct:
This is not correct:
However, modifying the depth frame directly would be ideal.. |
It's great to hear that you achieved a solution. Thanks very much for the update! If depth is aligned to color then the color intrinsics should be used, as in the aligned image the color sensor's center-line becomes the origin coordinate for depth. |
Case closed due to solution achieved and no further comments received. |
@MartyG-RealSense Hey I am trying to get point cloud of a specific region from depth map. To isolate an object in the depth map, I am using a segmentation model and then get the mask coordinates and overlay on the depth map. This is the result of that process: |
Hi @sanjaiiv04 Are you using C++ or Python programming language to generate your depth map, please? |
@MartyG-RealSense I am using Python here. |
I am not expert on Open3D programming, unfortunately. But there is an Open3D pyrealsense2 pointcloud script at isl-org/Open3D#473 (comment) that you could potentially adapt to add your cropping to it. |
Issue Description
I'm trying to create a pointcloud from a depth map in open3d using the camera intrinsics.
(I want to do this in open3d because I want to apply custom post-processing filters on the depth map, and I think its not possible to reconstruct a pyrealsense depth frame from a depth map in python.)
The pointcloud created using pyrealsense and the pointcloud created from a depth map in open3d differ a lot. The one created using pyrealsense looks correct. The open3d pointcloud is much narrower in x and y, but stretched in z.
(I applied filters to the depth map to smooth it to make the difference easier to see):
The intrinsics of the camera look correct:
What could be the problem?
The text was updated successfully, but these errors were encountered: