isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.21k stars 2.28k forks source link

add RemoveDuplicatedPoints method to Pointcloud #4477

Open hernot opened 2 years ago

hernot commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

At the end of registering mutliple point clouds using IPC registration eg point to plane typically a single point cloud is formed. In some cases downsampling to a coarser grid is not an option or one wants to keep the raw set of points which likely contains serveral points which are to be considered duplicated. Removeing them before storing or further processing would simplifies further processing a lot and reduces the size required on disk. for example for a surface consisting of 12 3D camera scans this can be about a factor of 5 to 6

Describe the solution you'd like A clear and concise description of what you want to happen.

A dedicated RemoveDuplicatedPoints method equal to the RemoveDuplicatedVertices Method for TriangleMesh and TetraMesh would simplify the game.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Currently I do abuse TriangleMesh.remove_duplicated_vertices:

point_cloud = o3d.io.read_point_cloud(filename)
clear_points = o3d.geometry.TriangleMesh()
clear_points.vertices = o3d.uitility.Vector3dVector(point_cloud.points)
clear_points.vertex_normals = o3d.uitility.Vector3dVector(point_cloud.normals)
clear_points.vertex_colors = o3d.uitility.Vector3dVector(point_cloud.colors)
clear_points.remove_duplicated_vertices()
point_cloud.points = o3d.utility.Vector3dVector(clear_points.vertices)
point_cloud.normals = o3d.utility.Vector3dVector(clear_points.vertex_normals)
point_cloud.colors= o3d.utility.Vector3dVector(clear_points.vertex_colors)
reyanshsolis commented 2 years ago

PR #5047

hernot commented 1 year ago

If I did not phantazise this i have seen the pr #5047 released in 0.16 or 0.17 so this can be closed if not blocked by other related issues.