PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.97k stars 4.62k forks source link

mesh_sampling introducing new points in the pointcloud? #1863

Closed samarth-robo closed 7 years ago

samarth-robo commented 7 years ago

:warning: This is a issue tracker, please use our mailing list for questions: www.pcl-users.org. :warning:

Your Environment

Expected Behavior

mesh_sampling should only sample points on the surface of the object in the provided PLY file. Example PLY file: meshlab

Current Behavior

mesh_sampling seems to also sample from free space, for small values of leaf_size. Example output of pcl_mesh_sampling with leaf_size=0.01 (1 cm) leaf_1cm Maybe the screenshot is not very clear - but the sampling seems to be working OK if I zoom in the PCL Visualizer. leaf_size=0.001 (1 mm) leaf_1_mm You can clearly see here that points are sampled outside the surface of the objects e.g. between the two legs of the clamp.

Possible Solution

Code to Reproduce

pcl_mesh_sampling tsdf_mesh.ply tsdf_mesh.pcd -leaf_size 0.001 tsdf_mesh.zip

Context

Trying to covert non-textured CAD models from the YCB dataset to point-clouds by sampling the surface. They also have meshes constructed with Poisson instead of TSDF. Trying to sample from those meshes also presents the same problem.

samarth-robo commented 7 years ago

It occurs because of this issue: http://www.pcl-users.org/Misleading-examples-in-mesh2pcd-mesh-sampling-tools-td3832009.html The error is fixed in the latest version of the file on GitHub.