PlaneDetection
PlaneDetection copied to clipboard
Deployment example using Open3D support
Hi Abner,
Thank you for your excellent work on this project.
I noticed that the algorithm supports Open3D, which is great. I've attempted to deploy it using Open3D and wanted to confirm whether I'm following the correct approach. Could you kindly take a look and let me know if this is the intended way to use it?
If it's correct, it might serve as a helpful example for new users looking to get started.
Thanks again!
import open3d as o3d
pcd = o3d.io.read_point_cloud("example.ply")
#Estimate normals
pcd.estimate_normals(
search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.05, max_nn=30)
)
#Optionally, orient the normals consistently (recommended)
pcd.orient_normals_consistent_tangent_plane(30)
#Detect planar patches
#Parameters: normal_variance_threshold_deg, coplanarity_deg, outlier_ratio, min_plane_edge_length, min_num_points, search_param
patches = pcd.detect_planar_patches(
normal_variance_threshold_deg=5.0,
coplanarity_deg=5.0,
outlier_ratio=0.5,
min_plane_edge_length=0.05,
min_num_points=100,
search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.05, max_nn=30)
)