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

Function main

test/surface/test_organized_fast_mesh.cpp:112–174  ·  view source on GitHub ↗

---[ */

Source from the content-addressed store, hash-verified

110
111/* ---[ */
112int
113main (int argc, char** argv)
114{
115 if (argc < 2)
116 {
117 std::cerr << "No test file given. Please download `bun0.pcd` and pass its path to the test." << std::endl;
118 return (-1);
119 }
120
121 // Load file
122 pcl::PCLPointCloud2 cloud_blob;
123 loadPCDFile (argv[1], cloud_blob);
124 fromPCLPointCloud2 (cloud_blob, *cloud);
125
126 // Create search tree
127 tree.reset (new search::KdTree<PointXYZ> (false));
128 tree->setInputCloud (cloud);
129
130 // Normal estimation
131 NormalEstimation<PointXYZ, Normal> n;
132 PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ());
133 n.setInputCloud (cloud);
134 //n.setIndices (indices[B);
135 n.setSearchMethod (tree);
136 n.setKSearch (20);
137 n.compute (*normals);
138
139 // Concatenate XYZ and normal information
140 pcl::concatenateFields (*cloud, *normals, *cloud_with_normals);
141
142 // Create search tree
143 tree2.reset (new search::KdTree<PointNormal>);
144 tree2->setInputCloud (cloud_with_normals);
145
146 // Process for update cloud
147 if(argc == 3){
148 pcl::PCLPointCloud2 cloud_blob1;
149 loadPCDFile (argv[2], cloud_blob1);
150 fromPCLPointCloud2 (cloud_blob1, *cloud1);
151 // Create search tree
152 tree3.reset (new search::KdTree<PointXYZ> (false));
153 tree3->setInputCloud (cloud1);
154
155 // Normal estimation
156 NormalEstimation<PointXYZ, Normal> n1;
157 PointCloud<Normal>::Ptr normals1 (new PointCloud<Normal> ());
158 n1.setInputCloud (cloud1);
159
160 n1.setSearchMethod (tree3);
161 n1.setKSearch (20);
162 n1.compute (*normals1);
163
164 // Concatenate XYZ and normal information
165 pcl::concatenateFields (*cloud1, *normals1, *cloud_with_normals1);
166 // Create search tree
167 tree4.reset (new search::KdTree<PointNormal>);
168 tree4->setInputCloud (cloud_with_normals1);
169 }

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