title: PCL estimates wrong normal direction in some parts
body: <p>I am using PCL to calculate the normal of point clouds. With Meshlab, normals are as the right one, although all normals are from outer to inner, it will be correct after I reverse them all.</p>
  
  <p>But when I use PCL to do this, the direction of some normals are wrong as the left picture illustrates.</p>
  
  <p><a href="https://i.stack.imgur.com/Tysck.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Tysck.png" alt="enter image description here"></a></p>
  
  <p>To make more sense, Below are reconstructed surfaces using meshlab and PCL, with the normal estimated by PCL, I cannot get the correct result.
  <a href="https://i.stack.imgur.com/Hrgt3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Hrgt3.png" alt="enter image description here"></a></p>
  
  <p>My code are as follow and my sample .ply data is <a href="https://nofile.io/f/HFSWOmDF85e/tooth.ply" rel="noreferrer">here</a>, and my model could be found here, I have tried to change radius, number of neighbor and the centroid position, but coundn't fix this.</p>
  
  <pre><code>cout &lt;&lt; "begin normal estimation" &lt;&lt; endl;
  NormalEstimationOMP&lt;PointXYZ, Normal&gt; ne;
  pcl::search::KdTree&lt;pcl::PointXYZ&gt;::Ptr tree(new pcl::search::KdTree&lt;pcl::PointXYZ&gt;());
  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&lt;Normal&gt;::Ptr cloud_normals (new PointCloud&lt;Normal&gt;());
  ne.compute(*cloud_normals);
  cout &lt;&lt; "normal estimation complete" &lt;&lt; endl;
  </code></pre>
  
  <p>Maybe I should adjust some other parameters? Or switch to a better methods? Thank you for your attention!</p>