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

detect_planar_patches fails with perfectly flat surfaces #6550

Closed
3 tasks done
chisarie opened this issue Dec 26, 2023 · 0 comments · Fixed by #6608
Closed
3 tasks done

detect_planar_patches fails with perfectly flat surfaces #6550

chisarie opened this issue Dec 26, 2023 · 0 comments · Fixed by #6608
Labels
bug Not a build issue, this is likely a bug.

Comments

@chisarie
Copy link

Checklist

Describe the issue

I have a point cloud from a simulated cube, which is perfectly flat. I want to use the function detect_planar_patches to find the faces of the cube from the point cloud. Unfortunately the returned patches are wrong, I only get two small patches on one of the faces. The interesting part is that, if I add small random noise to the point cloud, the returned patches are correct again! You can download the ply file to reproduce the issue here: cube_pcd.ply
See the images:

Default pcd:
Screenshot from 2023-12-26 12-06-17

Noisy pcd:
Screenshot from 2023-12-26 12-06-35

Steps to reproduce the bug

import numpy as np
import open3d as o3d

cube_pcd = o3d.io.read_point_cloud("cube_pcd.ply")
patches = cube_pcd.detect_planar_patches()
o3d.visualization.draw_geometries([cube_pcd] + patches)

# Create a new PointCloud with noisy points
cube_points = np.array(cube_pcd.points)
noisy_points = cube_points + np.random.normal(0, 0.001, size=cube_points.shape)
noisy_pcd = o3d.geometry.PointCloud(o3d.utility.Vector3dVector(noisy_points))
noisy_pcd.estimate_normals()
noisy_pcd.orient_normals_towards_camera_location()
new_patches = noisy_pcd.detect_planar_patches()
o3d.visualization.draw_geometries([noisy_pcd] + new_patches)

Error message

No response

Expected behavior

No response

Open3D, Python and System information

- Operating system: Ubuntu 20.04
- Python version: Python 3.9
- Open3D version: tried both latest and 0.17.0
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip inside a conda env

Additional information

No response

@chisarie chisarie added the bug Not a build issue, this is likely a bug. label Dec 26, 2023
chunibyo-wly added a commit to chunibyo-wly/Open3D that referenced this issue Jan 17, 2024
chunibyo-wly added a commit to chunibyo-wly/Open3D that referenced this issue Jan 17, 2024
ssheorey pushed a commit that referenced this issue Mar 19, 2024
…oise-free planes (issue #6550) (#6608)

The coplanar patches for noise-free plane are not merged. The reason is normal deviation diff threshold is 1, and the dot product of direction normal (plane patches) would be too. So the robust planar test will fail on this.

And also the box size need to be larger than zero, but for ideal points, it maybe calculated to zero. So we need to set a tolerance on this too.
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

Successfully merging a pull request may close this issue.

1 participant