"not enough correspondence" error when useing icp with some values

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

"not enough correspondence" error when useing icp with some values

saranshvora
This post was updated on .
Hi , I am with a situation can someone help me out on how to solve it ??
I am getting this error : pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters
Using these point clouds :

trans_2_0.pcd is my source file & my target file is CloudCluster_3.pcd

along with these parameters


          pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB> icp;
          icp.setInputSource(cloud_in);// object file
          icp.setInputTarget(cloud_target); // segment
          //icp.setRANSACOutlierRejectionThreshold(5);
          icp.setRANSACOutlierRejectionThreshold(500);
          //icp.setRANSACIterations(100);
          // Set the max correspondence distance to 5cm (e.g., correspondences with higher distances will be ignored)
          icp.setMaxCorrespondenceDistance (50);
          // Set the maximum number of iterations (criterion 1)
          icp.setMaximumIterations (500);

          // Set the transformation epsilon (criterion 2)
          icp.setTransformationEpsilon (1e-32);
          //std::cout << " getTransformationEpsilon epsilon: "<<icp.getTransformationEpsilon() << std::endl;
          //std::cout << " getEuclideanFitnessEpsilon epsilon: "<<icp.getEuclideanFitnessEpsilon() << std::endl;
          // Set the euclidean distance difference epsilon (criterion 3)
          icp.setEuclideanFitnessEpsilon (1);

          pcl::PointCloud<pcl::PointXYZRGB> Final;
          icp.align(Final);
          std::cout << " \n has converged:" << icp.hasConverged() << "\n score: " <<icp.getFitnessScore() << std::endl;
            std::cout << "final trans: "<<icp.getFinalTransformation() << std::endl;

            std::cout << "has converged:" << icp.hasConverged()
            << " score: " << icp.getFitnessScore() << std::endl;

            if (icp.hasConverged() && (icp.getFitnessScore() < 0.0007) &&
            (icp.getFitnessScore() < 1E-32)) {
            Eigen::Matrix4f transform_tmp_icp = icp.getFinalTransformation();

            pcl::transformPointCloud(*cloud_in, *cloud_icp,
            transform_tmp_icp);
            }

Thank You,
Saransh