/////////////////////////////////////////////////////////////////////////////////////////////////////////////
| 58 | |
| 59 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 60 | TEST (PCL, FLARELocalReferenceFrameEstimation) |
| 61 | { |
| 62 | pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal> ()); |
| 63 | pcl::PointCloud<pcl::ReferenceFrame> bunny_LRF; |
| 64 | |
| 65 | constexpr float mesh_res = 0.005f; |
| 66 | |
| 67 | // Compute normals |
| 68 | pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne; |
| 69 | |
| 70 | ne.setRadiusSearch (2.0f*mesh_res); |
| 71 | ne.setViewPoint (1, 1, 10); |
| 72 | ne.setInputCloud (cloud); |
| 73 | ne.setSearchMethod (tree); |
| 74 | |
| 75 | ne.compute (*normals); |
| 76 | |
| 77 | // Compute FLARE LRF |
| 78 | pcl::FLARELocalReferenceFrameEstimation<pcl::PointXYZ, pcl::Normal, pcl::ReferenceFrame> lrf_estimator; |
| 79 | |
| 80 | lrf_estimator.setRadiusSearch (5 * mesh_res); |
| 81 | lrf_estimator.setTangentRadius (20 * mesh_res); |
| 82 | |
| 83 | lrf_estimator.setInputCloud (cloud); |
| 84 | lrf_estimator.setSearchSurface (cloud); |
| 85 | lrf_estimator.setInputNormals (normals); |
| 86 | lrf_estimator.setSearchMethod (tree); |
| 87 | lrf_estimator.setSearchMethodForSampledSurface (sampled_tree); |
| 88 | lrf_estimator.setSearchSampledSurface (sampled_cloud); |
| 89 | |
| 90 | lrf_estimator.compute (bunny_LRF); |
| 91 | |
| 92 | // TESTS |
| 93 | EXPECT_TRUE (bunny_LRF.is_dense); |
| 94 | |
| 95 | // Expected Results |
| 96 | float score_15 = -0.0059431493f; |
| 97 | Eigen::Vector3f point_15_x (-0.46138301f, 0.75752199f, -0.46182927f); |
| 98 | Eigen::Vector3f point_15_y (-0.78785944f, -0.11049186f, 0.60586232f); |
| 99 | Eigen::Vector3f point_15_z (0.40792558f, 0.64339107f, 0.64779979f); |
| 100 | float score_45 = 0.018918669f; |
| 101 | Eigen::Vector3f point_45_x (0.63724411f, -0.74846953f, -0.18361199f); |
| 102 | Eigen::Vector3f point_45_y (0.76468521f, 0.58447874f, 0.27136898f); |
| 103 | Eigen::Vector3f point_45_z (-0.095794097f, -0.31333363f, 0.94479918f); |
| 104 | float score_163 = -0.050190225f; |
| 105 | Eigen::Vector3f point_163_x (-0.67064381f, 0.45722002f, 0.58411193f); |
| 106 | Eigen::Vector3f point_163_y (-0.58332449f, -0.81150508f, -0.034525186f); |
| 107 | Eigen::Vector3f point_163_z (0.45822418f, -0.36388087f, 0.81093854f); |
| 108 | float score_253 = -0.025943652f; |
| 109 | Eigen::Vector3f point_253_x (0.88240892f, -0.26585102f, 0.38817233f); |
| 110 | Eigen::Vector3f point_253_y (0.19853911f, 0.95840079f, 0.20506138f); |
| 111 | Eigen::Vector3f point_253_z (-0.42654046f, -0.10388060f, 0.89848322f); |
| 112 | |
| 113 | |
| 114 | //Test Results |
| 115 | for (int d = 0; d < 3; ++d) |
| 116 | { |
| 117 | EXPECT_NEAR (point_15_x[d], bunny_LRF.at (15).x_axis[d], 1E-3); |
nothing calls this directly
no test coverage detected