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

Function saveCloud

tools/train_unary_classifier.cpp:161–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void
162saveCloud (const std::string &filename, std::vector<FeatureT, Eigen::aligned_allocator<FeatureT> > &output)
163{
164 TicToc tt;
165 tt.tic ();
166
167 if (output.size () == 1)
168 {
169 print_highlight ("Saving "); print_value ("%s ", filename.c_str ());
170 PCDWriter w;
171 w.write (filename, output[0]);
172
173 print_info ("[done, ");
174 print_value ("%g", tt.toc ());
175 print_info (" ms : "); print_value ("%d", output[0].width * output[0].height);
176 print_info (" features]\n");
177 }
178 else
179 {
180 for (std::size_t i = 0; i < output.size (); i++)
181 {
182 std::string fname (filename);
183 std::string s = std::to_string(static_cast<int> (i) );
184 fname += "_" + s + ".pcd";
185
186 print_highlight ("Saving "); print_value ("%s ", fname.c_str ());
187
188 PCDWriter w;
189 w.write (fname, output[i]);
190
191 print_info ("[done, ");
192 print_value ("%g", tt.toc ());
193 print_info (" ms , ");
194 print_value ("%d", i);
195 print_info (" objects : ");
196 print_value ("%d", output[i].width * output[i].height);
197 print_info (" features]\n");
198 }
199 }
200}
201
202/* ---[ */
203int

Callers 1

mainFunction · 0.70

Calls 5

print_valueFunction · 0.85
ticMethod · 0.80
tocMethod · 0.80
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected