PCL evaluates the wrong direction in some parts

I use PCL to compute the normal of point clouds. With Meshlab, normals are correct, although all normals are from external to internal, this will be correct after I canceled all of them.

But when I use PCL for this, the direction of some normals is wrong, as the left image shows.

enter image description here

To make more sense, below reconstructed surfaces using meshlab and PCL, with a normal value estimated using PCL, I cannot get the correct result. enter image description here

My code is as follows, and my example data is .ply here , and my model can be found here, I tried to change the radius, the number of neighbors and the position of the centroid, but not fix it.

cout << "begin normal estimation" << endl;
NormalEstimationOMP<PointXYZ, Normal> ne;
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ>());
ne.setSearchMethod(tree);
ne.setNumberOfThreads(8);
ne.setInputCloud(filtered);
ne.setKSearch(15);
ne.setRadiusSearch(5);

Eigen::Vector4f centroid;
compute3DCentroid(*filtered, centroid);
ne.setViewPoint(centroid[0], centroid[1], centroid[2]);

PointCloud<Normal>::Ptr cloud_normals (new PointCloud<Normal>());
ne.compute(*cloud_normals);
cout << "normal estimation complete" << endl;

, ? ? !

+4
1

, , . ( ) , . .

, , .

, - .

  • , , , , (, pointIndices).

  •    ( ). , .

  • .

. , . "".

AFAIK PCL - "" .

+3

Source: https://habr.com/ru/post/1689667/


All Articles