---[ */
| 273 | |
| 274 | /* ---[ */ |
| 275 | int |
| 276 | main (int argc, char** argv) |
| 277 | { |
| 278 | if (argc < 2) |
| 279 | { |
| 280 | std::cerr << "No test file given. Please download `bun0.pcd` and pass its path to the test." << std::endl; |
| 281 | return (-1); |
| 282 | } |
| 283 | |
| 284 | // Load file |
| 285 | pcl::PCLPointCloud2 cloud_blob; |
| 286 | loadPCDFile (argv[1], cloud_blob); |
| 287 | fromPCLPointCloud2 (cloud_blob, *cloud); |
| 288 | |
| 289 | // Create search tree |
| 290 | tree.reset (new search::KdTree<PointXYZ> (false)); |
| 291 | tree->setInputCloud (cloud); |
| 292 | |
| 293 | // Normal estimation |
| 294 | NormalEstimation<PointXYZ, Normal> n; |
| 295 | PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ()); |
| 296 | n.setInputCloud (cloud); |
| 297 | //n.setIndices (indices[B); |
| 298 | n.setSearchMethod (tree); |
| 299 | n.setKSearch (20); |
| 300 | n.compute (*normals); |
| 301 | |
| 302 | // Concatenate XYZ and normal information |
| 303 | pcl::concatenateFields (*cloud, *normals, *cloud_with_normals); |
| 304 | |
| 305 | // Create search tree |
| 306 | tree2.reset (new search::KdTree<PointNormal>); |
| 307 | tree2->setInputCloud (cloud_with_normals); |
| 308 | |
| 309 | // Process for update cloud |
| 310 | if (argc == 3) |
| 311 | { |
| 312 | pcl::PCLPointCloud2 cloud_blob1; |
| 313 | loadPCDFile (argv[2], cloud_blob1); |
| 314 | fromPCLPointCloud2 (cloud_blob1, *cloud1); |
| 315 | // Create search tree |
| 316 | tree3.reset (new search::KdTree<PointXYZ> (false)); |
| 317 | tree3->setInputCloud (cloud1); |
| 318 | |
| 319 | // Normal estimation |
| 320 | NormalEstimation<PointXYZ, Normal> n1; |
| 321 | PointCloud<Normal>::Ptr normals1 (new PointCloud<Normal> ()); |
| 322 | n1.setInputCloud (cloud1); |
| 323 | |
| 324 | n1.setSearchMethod (tree3); |
| 325 | n1.setKSearch (20); |
| 326 | n1.compute (*normals1); |
| 327 | |
| 328 | // Concatenate XYZ and normal information |
| 329 | pcl::concatenateFields (*cloud1, *normals1, *cloud_with_normals1); |
| 330 | // Create search tree |
| 331 | tree4.reset (new search::KdTree<PointNormal>); |
| 332 | tree4->setInputCloud (cloud_with_normals1); |
nothing calls this directly
no test coverage detected