Fitness score for broken down ICP

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Fitness score for broken down ICP

Jack14
Hi!

We have been trying to implement ICP to register two point clouds. To better
understand the individual steps, we have decided to break down the process.
This looks somewhat like this

// initialization
   
pcl::registration::TransformationEstimationPointToPlane<pcl::PointNormal,
pcl::PointNormal, double> transformation_estimation;

    pcl::CorrespondencesPtr correspondences(new pcl::Correspondences());
    pcl::CorrespondencesPtr filtered_correspondences(new
pcl::Correspondences());

    Eigen::Matrix4d final_transform(Eigen::Matrix4d::Identity());
    Eigen::Matrix4d transform;

    int iteration = 0;
   
pcl::registration::DefaultConvergenceCriteria<double>convergence_criteria(iteration,
transform, *correspondences);
    convergence_criteria.setMaximumIterations(max_number_iterations_);
    convergence_criteria.setRelativeMSE(rel_mse_);

    PointCloudNormal::Ptr camera1_cloud_aligned(new PointCloudNormal());
    PointCloud::Ptr camera1_cloud_smoothed_aligned(new PointCloud());

    // iterations
    do
    {
        pcl::transformPointCloudWithNormals(*camera1_cloud_no_nans,
*camera1_cloud_aligned, final_transform); // cloud_no_nans is smoothed and
subsampled cloud with normals but without nans

        findCorresponces(*camera1_cloud_aligned, *camera2_cloud_no_nans,
*correspondences); // based on distance
        rejectCorrespondences(*camera1_cloud_aligned,
*camera2_cloud_no_nans, correspondences, *filtered_correspondences); //based
on median distance and surface normal

        if(enable_visualizer_)
        {
           // visualization
        }

       
transformation_estimation.estimateRigidTransformation(*camera1_cloud_aligned,
*camera2_cloud_no_nans, *filtered_correspondences, transform);
        final_transform = transform * final_transform;
        iteration++;
    }
    while(!convergence_criteria.hasConverged());

I have two questions:
1. Will findCorrespondences (
pcl::registration::CorrespondenceEstimation<pcl::PointNormal,
pcl::PointNormal>) also use the points' normals to calculate a distance?
2. Is it possible to retrieve a (fitness) score showing how well the
registration worked in the end? Or do I have to transfer all this to use the
ICP class, which has a getFitnessScore() method?

Thanks!



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Fitness score for broken down ICP

Sérgio Agostinho
  1. Regarding CorrespondenceEstimation, it uses KdTree.nearestKSearch () to find the correspondence points and KdTree  performs n-dimensional search. So yes, it will use as many dimensions as your point has, in this case including the normals.

  2. DefaultConvergenceCriteria has the methods to provide you what you want i.e., getRelative/AbsoluteMSE. Invoke it after your registration step.


Cheers



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fitness score for broken down ICP

Jack14
Hi Sergio!

Thanks for your reply. I believe getRelativeMSE() and getAbsoluteMSE()
always return the same values, i.e. the value you specified with
setRelativeMSE() or setAbsoluteMSE(), respectively. They do not reflect the
current "fitness score", do they?



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Fitness score for broken down ICP

Sérgio Agostinho

You are indeed right!

The method you want is calculateMSE in the same class. Unfortunately it's defined within a protected scope which feels wrong, so feel free to submit a pull request to the issue tracker exposing it to public scope.

Cheers


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

signature.asc (849 bytes) Download Attachment