add new_added_pts compute

This commit is contained in:
2024-10-01 14:51:45 +08:00
parent 16d1f8ab67
commit 7b28cf9e91
3 changed files with 19 additions and 0 deletions

View File

@@ -31,6 +31,18 @@ class ReconstructionUtil:
return filtered_sampled_points[:, :3]
@staticmethod
def get_new_added_points(old_combined_pts, new_pts, threshold=0.005):
if old_combined_pts.size == 0:
return new_pts
if new_pts.size == 0:
return np.array([])
tree = cKDTree(old_combined_pts)
distances, _ = tree.query(new_pts, k=1)
new_added_points = new_pts[distances > threshold]
return new_added_points
if __name__ == "__main__":
import os
root = "/media/hofee/data/project/python/nbv_reconstruction/nbv_rec_visualize/data/sample/"