---[ */
| 83 | |
| 84 | /* ---[ */ |
| 85 | int |
| 86 | main (int argc, char** argv) |
| 87 | { |
| 88 | if (argc < 2) |
| 89 | { |
| 90 | std::cerr << "No test file given. Please download `bun0.pcd` and pass its path to the test." << std::endl; |
| 91 | return (-1); |
| 92 | } |
| 93 | |
| 94 | // Load file |
| 95 | pcl::PCLPointCloud2 cloud_blob; |
| 96 | loadPCDFile (argv[1], cloud_blob); |
| 97 | fromPCLPointCloud2 (cloud_blob, *cloud); |
| 98 | |
| 99 | // Create search tree |
| 100 | tree.reset (new search::KdTree<PointXYZ> (false)); |
| 101 | tree->setInputCloud (cloud); |
| 102 | |
| 103 | // Normal estimation |
| 104 | NormalEstimation<PointXYZ, Normal> n; |
| 105 | PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ()); |
| 106 | n.setInputCloud (cloud); |
| 107 | //n.setIndices (indices[B); |
| 108 | n.setSearchMethod (tree); |
| 109 | n.setKSearch (20); |
| 110 | n.compute (*normals); |
| 111 | |
| 112 | // Concatenate XYZ and normal information |
| 113 | pcl::concatenateFields (*cloud, *normals, *cloud_with_normals); |
| 114 | |
| 115 | // Create search tree |
| 116 | tree2.reset (new search::KdTree<PointNormal>); |
| 117 | tree2->setInputCloud (cloud_with_normals); |
| 118 | |
| 119 | // Process for update cloud |
| 120 | if(argc == 3){ |
| 121 | pcl::PCLPointCloud2 cloud_blob1; |
| 122 | loadPCDFile (argv[2], cloud_blob1); |
| 123 | fromPCLPointCloud2 (cloud_blob1, *cloud1); |
| 124 | // Create search tree |
| 125 | tree3.reset (new search::KdTree<PointXYZ> (false)); |
| 126 | tree3->setInputCloud (cloud1); |
| 127 | |
| 128 | // Normal estimation |
| 129 | NormalEstimation<PointXYZ, Normal> n1; |
| 130 | PointCloud<Normal>::Ptr normals1 (new PointCloud<Normal> ()); |
| 131 | n1.setInputCloud (cloud1); |
| 132 | |
| 133 | n1.setSearchMethod (tree3); |
| 134 | n1.setKSearch (20); |
| 135 | n1.compute (*normals1); |
| 136 | |
| 137 | // Concatenate XYZ and normal information |
| 138 | pcl::concatenateFields (*cloud1, *normals1, *cloud_with_normals1); |
| 139 | // Create search tree |
| 140 | tree4.reset (new search::KdTree<PointNormal>); |
| 141 | tree4->setInputCloud (cloud_with_normals1); |
| 142 | } |
nothing calls this directly
no test coverage detected