---[ */
| 240 | |
| 241 | /* ---[ */ |
| 242 | int |
| 243 | main (int argc, char** argv) |
| 244 | { |
| 245 | if (argc < 2) |
| 246 | { |
| 247 | std::cerr << "No test file given. Please download `bun0.pcd` and pass its path to the test." << std::endl; |
| 248 | return (-1); |
| 249 | } |
| 250 | |
| 251 | // Load file |
| 252 | pcl::PCLPointCloud2 cloud_blob; |
| 253 | loadPCDFile (argv[1], cloud_blob); |
| 254 | fromPCLPointCloud2 (cloud_blob, *cloud); |
| 255 | |
| 256 | // Create search tree |
| 257 | tree.reset (new search::KdTree<PointXYZ> (false)); |
| 258 | tree->setInputCloud (cloud); |
| 259 | |
| 260 | // Normal estimation |
| 261 | NormalEstimation<PointXYZ, Normal> n; |
| 262 | PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ()); |
| 263 | n.setInputCloud (cloud); |
| 264 | //n.setIndices (indices[B); |
| 265 | n.setSearchMethod (tree); |
| 266 | n.setKSearch (20); |
| 267 | n.compute (*normals); |
| 268 | |
| 269 | // Concatenate XYZ and normal information |
| 270 | pcl::concatenateFields (*cloud, *normals, *cloud_with_normals); |
| 271 | |
| 272 | // Create search tree |
| 273 | tree2.reset (new search::KdTree<PointNormal>); |
| 274 | tree2->setInputCloud (cloud_with_normals); |
| 275 | |
| 276 | // Process for update cloud |
| 277 | if(argc == 3){ |
| 278 | pcl::PCLPointCloud2 cloud_blob1; |
| 279 | loadPCDFile (argv[2], cloud_blob1); |
| 280 | fromPCLPointCloud2 (cloud_blob1, *cloud1); |
| 281 | // Create search tree |
| 282 | tree3.reset (new search::KdTree<PointXYZ> (false)); |
| 283 | tree3->setInputCloud (cloud1); |
| 284 | |
| 285 | // Normal estimation |
| 286 | NormalEstimation<PointXYZ, Normal> n1; |
| 287 | PointCloud<Normal>::Ptr normals1 (new PointCloud<Normal> ()); |
| 288 | n1.setInputCloud (cloud1); |
| 289 | |
| 290 | n1.setSearchMethod (tree3); |
| 291 | n1.setKSearch (20); |
| 292 | n1.compute (*normals1); |
| 293 | |
| 294 | // Concatenate XYZ and normal information |
| 295 | pcl::concatenateFields (*cloud1, *normals1, *cloud_with_normals1); |
| 296 | // Create search tree |
| 297 | tree4.reset (new search::KdTree<PointNormal>); |
| 298 | tree4->setInputCloud (cloud_with_normals1); |
| 299 | } |
nothing calls this directly
no test coverage detected