Friday, September 26, 2014

PCL: pointcloud transformation




// transform the model by the transformation value
  Eigen::Matrix4f txform;
 

 //get the txformation matrix (discussed below)

 pcl::transformPointCloud (*cloud_3dmodel, *txformed_model, txform );


ICP can be used to estimate the transform :

Eigen::Matrix4f txform;

 pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB> icp;
 icp.setInputCloud(cloud_3dmodel);
 icp.setInputTarget(cloud_cluster);
 pcl::PointCloud<pcl::PointXYZRGB> Final;
 icp.align(Final);
 std::cout << "ICP has converged:" << icp.hasConverged() << " score: " <<    icp.getFitnessScore() << std::endl;

txform = icp.getFinalTransformation();

Refer:
http://stc0.wordpress.com/2013/03/22/equivalent-ways-to-register-two-point-clouds-with-pcl/
http://pointclouds.org/documentation/tutorials/iterative_closest_point.php 
http://robotica.unileon.es/mediawiki/index.php/PCL/OpenNI_tutorial_3:_Cloud_processing_%28advanced%29

No comments:

Post a Comment