Principle Curvature Error [closed]

asked 2013-04-30 18:16:25 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I am trying to calculate Principle curvatures and directions as well. Unfortunately, it gave error. I am dealing with more than 30000 points.Here is my sample points, program output, and code. Your suggestion most welcome. Thnx in advance.

Input:

-0.178011 -0.132448 0 
-0.023969 -0.087338 0 
  ...........   ...........  .. 
  ...........   ...........  ..

Output:

0 0 1 3.02923e-029 0 
-1.#IND -1.#IND -1.#IND 0 0 
...........   ...........  .. 
...........   ...........  ..

Code:

int main (...) 
{ 
///Load Point cloud 

pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne; 

ne.setInputCloud (cloud.makeShared()); 

pcl::search::KdTree<pcl::PointXYZ>::Ptr cloud_normal_tree (new pcl::search::KdTree<pcl::PointXYZ>()); 
 ne.setSearchMethod (cloud_normal_tree); 

// Output datasets 
pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>); 


int k=15; 
ne.setKSearch (k); 

ne.compute (*normals); 

pcl::PrincipalCurvaturesEstimation<pcl::PointXYZ, pcl::Normal, pcl::PrincipalCurvatures> pc; 

pc.setInputCloud (cloud.makeShared()); 

pc.setInputNormals (normals); 

pcl::search::KdTree<pcl::PointXYZ>::Ptr pc_tree (new pcl::search::KdTree<pcl::PointXYZ> ()); 
pc.setSearchMethod (pc_tree); 

int kk=15; 
pc.setKSearch(kk); 
pcl::PointCloud<pcl::PrincipalCurvatures>::Ptr pc_output (new pcl::PointCloud<pcl::PrincipalCurvatures> ()); 

pc.compute (*pc_output); 

cout<<pc_output->points.size()<<endl; 

for (i = 0; i <pc_output->points.size(); ++i) 
                          std::cerr << "    " << pc_output->points[i].principal_curvature_x  << " " << pc_output->points[i].principal_curvature_y << " " << pc_output->points[i].principal_curvature_z << " " << pc_output->points[i].pc1 << " " << pc_output->points[i].pc2 <<  std::endl; 

}
edit retag flag offensive reopen merge delete

Closed for the following reason PCL Question: The PCL community prefers to answer questions at http://www.pcl-users.org/ by tfoote
close date 2014-11-23 03:17:32.315273