MCPcopy Create free account
hub / github.com/LimHyungTae/patchwork / save_all_labels

Function save_all_labels

include/patchwork/utils.hpp:218–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216
217template <typename PointT>
218void save_all_labels(const pcl::PointCloud<PointT> &pc, string ABS_DIR, string seq, int count) {
219 std::string count_str = std::to_string(count);
220 std::string count_str_padded = std::string(NUM_ZEROS - count_str.length(), '0') + count_str;
221 std::string output_filename = ABS_DIR + "/" + seq + "/" + count_str_padded + ".csv";
222 ofstream sc_output(output_filename);
223
224 vector<int> labels(NUM_ALL_CLASSES, 0);
225 for (auto const &pt : pc.points) {
226 if (pt.label == 0)
227 labels[0]++;
228 else if (pt.label == 1)
229 labels[1]++;
230 else if (pt.label == 10)
231 labels[2]++;
232 else if (pt.label == 11)
233 labels[3]++;
234 else if (pt.label == 13)
235 labels[4]++;
236 else if (pt.label == 15)
237 labels[5]++;
238 else if (pt.label == 16)
239 labels[6]++;
240 else if (pt.label == 18)
241 labels[7]++;
242 else if (pt.label == 20)
243 labels[8]++;
244 else if (pt.label == 30)
245 labels[9]++;
246 else if (pt.label == 31)
247 labels[10]++;
248 else if (pt.label == 32)
249 labels[11]++;
250 else if (pt.label == 40)
251 labels[12]++;
252 else if (pt.label == 44)
253 labels[13]++;
254 else if (pt.label == 48)
255 labels[14]++;
256 else if (pt.label == 49)
257 labels[15]++;
258 else if (pt.label == 50)
259 labels[16]++;
260 else if (pt.label == 51)
261 labels[17]++;
262 else if (pt.label == 52)
263 labels[18]++;
264 else if (pt.label == 60)
265 labels[19]++;
266 else if (pt.label == 70)
267 labels[20]++;
268 else if (pt.label == 71)
269 labels[21]++;
270 else if (pt.label == 72)
271 labels[22]++;
272 else if (pt.label == 80)
273 labels[23]++;
274 else if (pt.label == 81)
275 labels[24]++;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected