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