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

Function main

test/surface/test_poisson.cpp:95–157  ·  view source on GitHub ↗

---[ */

Source from the content-addressed store, hash-verified

93
94/* ---[ */
95int
96main (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 }

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