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

Function main

test/surface/test_marching_cubes.cpp:104–166  ·  view source on GitHub ↗

---[ */

Source from the content-addressed store, hash-verified

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

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