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

voxel_down_sample() of t.geometry.PointCloud produces incorrect results #6172

Closed
3 tasks done
Alex-Dee opened this issue May 25, 2023 · 1 comment
Closed
3 tasks done
Labels
bug Not a build issue, this is likely a bug.

Comments

@Alex-Dee
Copy link

Alex-Dee commented May 25, 2023

Checklist

Describe the issue

I have tried switching from the legacy PointCloud to the new tensor based in open3d.t.geometry but encountered unexpected behavior of the voxel_down_sample() method. Instead of averaging the point coordinates in every voxel the method seems to just move them at the voxel's center. This obviously leads to information loss and renders the result unusable for further processing like plane detection etc. On the other hand the voxel_down_sample() method of the legacy PointCloud works fine and as expected.
Bildschirmfoto vom 2023-05-25 10-13-57

Steps to reproduce the bug

import open3d as o3d

path = "<path/to/pointcloud>"
pcd = o3d.io.read_point_cloud(path)
pcd = o3d.t.geometry.PointCloud.from_legacy(pcd)

pcd_down = pcd.voxel_down_sample(0.05)

o3d.visualization.gui.Application.instance.initialize()
window = o3d.visualization.gui.Application.instance.create_window(
        "Open3d", 2560, 1200
)
scene_widget = o3d.visualization.gui.SceneWidget()
scene_widget.scene = o3d.visualization.rendering.Open3DScene(window.renderer)
scene_widget.enable_scene_caching(True)
scene_widget.scene.set_background([0.3, 0.3, 0.3, 1])

window.add_child(scene_widget)

mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultUnlit"
scene_widget.scene.add_geometry("pcd", pcd_down, mat)
o3d.visualization.gui.Application.instance.run()

Error message

None

Expected behavior

voxel_down_sample() should average all coordinates in each voxel to get an accurate representation of the original point cloud.

Open3D, Python and System information

- Operating system: Ubuntu 22.04 
- Python version: Python 3.9 
- Open3D version: 0.17.0
- System architecture: x86 
- Is this a remote workstation?: no
- How did you install Open3D?: pip

Additional information

No response

@Alex-Dee Alex-Dee added the bug Not a build issue, this is likely a bug. label May 25, 2023
@ssheorey
Copy link
Member

ssheorey commented May 1, 2024

Closing as completed.

@ssheorey ssheorey closed this as completed May 1, 2024
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