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

PointCloud.detect_planar_patches() Crushes When the PointCloud has 10 or more Points with the Same Coordinates #6727

Closed
3 tasks done
organic-nailer opened this issue Mar 27, 2024 · 0 comments · Fixed by #6794
Labels
bug Not a build issue, this is likely a bug.

Comments

@organic-nailer
Copy link
Contributor

Checklist

Describe the issue

I tried to use PointCloud.detect_planar_patches() to detect planes from point cloud data. However, I noticed that it crashes the Python kernel when the coordinate data of PointCloud meets a certain condition. If PointCloud has 10 or more points with the same XYZ coordinates, PointCloud.detect_planar_patches() crashes the kernel (no error message is displayed).

Steps to reproduce the bug

import open3d as o3d
import numpy as np

pcd = o3d.geometry.PointCloud()
# define two planes
plane_a = np.random.rand(1000, 3)
plane_a[:, 2] *= 0.01
plane_b = np.random.rand(1000, 3)
plane_b[:, 1] *= 0.01
plane_b[:, 1] += 0.5

# prepare 10 points with the same coordinates
plane_b[:10, :] = [0, 1, 2]
pcd.points = o3d.utility.Vector3dVector(np.vstack((plane_a, plane_b)))

pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamKNN(knn=30))

# then crash here!
planar_boxes = pcd.detect_planar_patches()

print(planar_boxes)

geometries = [pcd]
for i, plane in enumerate(planar_boxes):
    mesh = o3d.geometry.TriangleMesh.create_from_oriented_bounding_box(plane, scale=[1,1,0.0001])
    mesh.paint_uniform_color(plane.color)
    geometries.append(mesh)
    geometries.append(plane)

o3d.visualization.draw_geometries(geometries)

Error message

No response

Expected behavior

No response

Open3D, Python and System information

- Operating system: Windows 11 64-bit
- Python version: Python 3.8.19
- Open3D version: 0.18.0
- System architecture: x86 (AMD Ryzen 4500)
- Is this a remote workstation?: no
- How did you install Open3D?: pip in a conda environment

Additional information

When I execute it on Jupyter Notebook, I received following error log and python kernel was crushed:

[error] Disposing session as kernel process died ExitCode: 3221225725, Reason:
21:13:04.624 [info] Dispose Kernel process 22812.

@organic-nailer organic-nailer added the bug Not a build issue, this is likely a bug. label Mar 27, 2024
@organic-nailer organic-nailer changed the title PointCloud.detect_planar_patches() Crushes When It has 10 or more Points with the Same Coordinates PointCloud.detect_planar_patches() Crushes When the PointCloud has 10 or more Points with the Same Coordinates Mar 27, 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

Successfully merging a pull request may close this issue.

1 participant