I have an unorganized, isotropic and volumetric point cloud, which I get from a uniformely dense and noise-free simulated CT scan of a halfed apple (without stem) and try to get a concave mesh with the MC Hoppe reconstruction algorithm from PCL. What I am getting though is a mesh that is completely
or partially sliced-through at frequent locations of the mesh, both vertically and horizontally:
Top view with slice “holes” that go all the way through the mesh.
Small area of the front view with weird vertical/horizontal slice patterns.
I don’t do anything special code-wise:
// Define search tree
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree = pcl::make_shared<pcl::search::KdTree<pcl::PointXYZ>>();
tree->setInputCloud(m_impl->pointCloud);
pcl::PointCloud<pcl::Normal>::Ptr cloud_normals = pcl::make_shared<pcl::PointCloud<pcl::Normal>>();
// Normal calculation
pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> n;
n.setInputCloud(m_impl->pointCloud);
n.setSearchMethod(tree);
n.setKSearch(20);
n.compute(*cloud_normals);
pcl::concatenateFields(*m_impl->pointCloud, *cloud_normals, *m_impl->preprocessedCloud);
//[...]
// Surface reconstruction
float dist_ignore = -1, percentage_extend_grid = 0.05, iso_level = 0.0;
pcl::search::KdTree<pcl::pcl::PointNormal>::Ptr tree = pcl::make_shared<pcl::search::KdTree<pcl::PointNormal>>();
tree->setInputCloud(m_impl->preprocessedCloud);
pcl::MarchingCubesHoppe<pcl::PointNormal> mch(dist_ignore, percentage_extend_grid, iso_level);
mch.setInputCloud(m_impl->preprocessedCloud);
mch.setIsoLevel(iso_level);
mch.setSearchMethod(tree);
mch.setPercentageExtendGrid(percentage_extend_grid);
mch.setGridResolution(64, 64, 64);
I have also changed the point type to PointXYZI to use the intensity values going from 0.0 to 1.0 to provide a better surface context, but the class doesn’t seem to use it at all, as nothing changes. The image resolution is 64×64 with 64 slices and increasing the grid resolution to 128x128x128 as a way to close the gaps also does not help and produces this hole-filled monstrosity. Do I do something wrong with the normal calculation or any other parts of the code/parameter choice?
Thank you in advance. If I forgot to provide an important detail, let me know.
albrechu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.