(vertices, colors, faces)
| 6 | import time |
| 7 | |
| 8 | def do_dbscan(vertices, colors, faces): |
| 9 | import hdbscan |
| 10 | |
| 11 | # Do the same thing with DBScan |
| 12 | start = time.time() |
| 13 | dbscan_pcd = o3d.geometry.PointCloud() |
| 14 | dbscan_pcd.points = o3d.utility.Vector3dVector(vertices) |
| 15 | dbscan_pcd.colors = o3d.utility.Vector3dVector(colors) |
| 16 | dbscan_pcd.estimate_normals() |
| 17 | |
| 18 | # HDBSCAN clustering |
| 19 | clusterer = hdbscan.HDBSCAN(min_cluster_size=500, min_samples=1) |
| 20 | clusterer.fit(np.concatenate((vertices, colors, np.array(dbscan_pcd.normals)), axis=1)) |
| 21 | comps = clusterer.labels_ |
| 22 | |
| 23 | end_dbscan = time.time() |
| 24 | print(f"HDBSCAN took {end_dbscan - end_dbscan:.4f} s") |
| 25 | |
| 26 | return comps, np.zeros((0, 2)) |
| 27 | |
| 28 | def do_felzenszwalb(vertices, colors, faces, num_points): |
| 29 | import felzenszwalb_cpp |
nothing calls this directly
no outgoing calls
no test coverage detected