| 159 | } |
| 160 | |
| 161 | void |
| 162 | saveCloud (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 | /* ---[ */ |
| 203 | int |