Created
March 27, 2012 10:48
-
-
Save hfaulds/2214794 to your computer and use it in GitHub Desktop.
ICP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PointCloud::ConstPtr alignedPointClouds() | |
| { | |
| PointCloud clouds_merged = *filterCloudByDepth(clouds[0]).get(); | |
| for(int i=1; i < NUM_CAPTURES; i++) { | |
| if(clouds[i]) { | |
| pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB> icp; | |
| icp.setMaxCorrespondenceDistance (0.5); | |
| icp.setTransformationEpsilon (1e-5); | |
| //icp.setEuclideanFitnessEpsilon (1); | |
| icp.setInputCloud(filterCloudByDepth(clouds[i])); | |
| icp.setInputTarget((new PointCloud(clouds_merged))->makeShared()); | |
| PointCloud cloud_aligned; | |
| icp.align(cloud_aligned); | |
| clouds_merged += cloud_aligned; | |
| } | |
| } | |
| return clouds_merged.makeShared(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment