The ICP package functions are as follows:
PCL::P OINTCLOUD<PCL::P ointxyz>::P tr icp_test (PCL::P OINTCLOUD<PCL::P ointxyz>::P tr Target, PCL:: POINTCLOUD<PCL::P ointxyz>::P tr source,int i)
{
PCL::P OINTCLOUD<PCL::P ointxyz>::P tr source_to_ Target (New PCL::P OINTCLOUD<PCL::P ointxyz>);
PCL::ITERATIVECLOSESTPOINT<PCL::P ointxyz, PCL::P ointxyz> ICP;
PCL::P OINTCLOUD<PCL::P ointxyz> Final; Storing the point cloud Icp.setinputsource (source) After the point cloud of the registration transformation source
;
Icp.setinputtarget (target);
Icp.setmaxcorrespondencedistance (m);
Icp.seteuclideanfitnessepsilon (1e-3);
Icp.setmaximumiterations (i);
Icp.align (Final); The source point cloud to final
eigen::matrix4f transformation = icp.getfinaltransformation () after the execution of the registration storage transformation;
Std::cout << icp.getfinaltransformation () << Std::endl; Print output The final estimate of the transformation matrix
Pcl::transformpointcloud (*source, *source_to_target, transformation);
return source_to_target;
}