@@ -651,50 +651,6 @@ TEST (SampleConsensusModelCircle3D, RANSAC)
651
651
EXPECT_NEAR ( 0.0 , coeff_refined[6 ], 1e-3 );
652
652
}
653
653
654
- TEST (SampleConsensusModelSphere, projectPoints)
655
- {
656
- Eigen::VectorXf model_coefficients (4 );
657
- model_coefficients << -0.32 , -0.89 , 0.37 , 0.12 ; // center and radius
658
-
659
- pcl::PointCloud<pcl::PointXYZ>::Ptr input (new pcl::PointCloud<pcl::PointXYZ>);
660
- input->emplace_back (-0.259754 , -0.950873 , 0.318377 ); // inlier, dist from center=0.10
661
- input->emplace_back ( 0.595892 , 0.455094 , 0.025545 ); // outlier, not projected
662
- input->emplace_back (-0.221871 , -0.973718 , 0.353817 ); // inlier, dist from center=0.13
663
- input->emplace_back (-0.332269 , -0.848851 , 0.437499 ); // inlier, dist from center=0.08
664
- input->emplace_back (-0.242308 , -0.561036 , -0.365535 ); // outlier, not projected
665
- input->emplace_back (-0.327668 , -0.800009 , 0.290988 ); // inlier, dist from center=0.12
666
- input->emplace_back (-0.173948 , -0.883831 , 0.403625 ); // inlier, dist from center=0.15
667
- input->emplace_back (-0.033891 , 0.624537 , -0.606994 ); // outlier, not projected
668
-
669
- pcl::SampleConsensusModelSphere<pcl::PointXYZ> model (input);
670
- pcl::Indices inliers = {0 , 2 , 3 , 5 , 6 };
671
-
672
- pcl::PointCloud<pcl::PointXYZ> projected_truth;
673
- projected_truth.emplace_back (-0.247705 , -0.963048 , 0.308053 );
674
- projected_truth.emplace_back (-0.229419 , -0.967278 , 0.355062 );
675
- projected_truth.emplace_back (-0.338404 , -0.828276 , 0.471249 );
676
- projected_truth.emplace_back (-0.327668 , -0.800009 , 0.290988 );
677
- projected_truth.emplace_back (-0.203158 , -0.885065 , 0.396900 );
678
-
679
- pcl::PointCloud<pcl::PointXYZ> projected_points;
680
- model.projectPoints (inliers, model_coefficients, projected_points, false );
681
- EXPECT_EQ (projected_points.size (), 5 );
682
- for (int i=0 ; i<5 ; ++i)
683
- EXPECT_XYZ_NEAR (projected_points[i], projected_truth[i], 1e-5 );
684
-
685
- pcl::PointCloud<pcl::PointXYZ> projected_points_all;
686
- model.projectPoints (inliers, model_coefficients, projected_points_all, true );
687
- EXPECT_EQ (projected_points_all.size (), 8 );
688
- EXPECT_XYZ_NEAR (projected_points_all[0 ], projected_truth[0 ], 1e-5 );
689
- EXPECT_XYZ_NEAR (projected_points_all[1 ], (*input)[1 ], 1e-5 );
690
- EXPECT_XYZ_NEAR (projected_points_all[2 ], projected_truth[1 ], 1e-5 );
691
- EXPECT_XYZ_NEAR (projected_points_all[3 ], projected_truth[2 ], 1e-5 );
692
- EXPECT_XYZ_NEAR (projected_points_all[4 ], (*input)[4 ], 1e-5 );
693
- EXPECT_XYZ_NEAR (projected_points_all[5 ], projected_truth[3 ], 1e-5 );
694
- EXPECT_XYZ_NEAR (projected_points_all[6 ], projected_truth[4 ], 1e-5 );
695
- EXPECT_XYZ_NEAR (projected_points_all[7 ], (*input)[7 ], 1e-5 );
696
- }
697
-
698
654
TEST (SampleConsensusModelCylinder, projectPoints)
699
655
{
700
656
Eigen::VectorXf model_coefficients (7 );
0 commit comments