MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / main

Function main

test/surface/test_gp3.cpp:242–304  ·  view source on GitHub ↗

---[ */

Source from the content-addressed store, hash-verified

240
241/* ---[ */
242int
243main (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 }

Callers

nothing calls this directly

Calls 8

loadPCDFileFunction · 0.85
fromPCLPointCloud2Function · 0.85
concatenateFieldsFunction · 0.85
resetMethod · 0.45
setInputCloudMethod · 0.45
setSearchMethodMethod · 0.45
setKSearchMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected