| 176 | } |
| 177 | |
| 178 | int |
| 179 | batchProcess (const std::vector<std::string> &pcd_files, std::string &output_dir, int max_it, double thresh, bool negative) |
| 180 | { |
| 181 | for (const auto &pcd_file : pcd_files) |
| 182 | { |
| 183 | // Load the first file |
| 184 | pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); |
| 185 | if (!loadCloud (pcd_file, *cloud)) |
| 186 | return (-1); |
| 187 | |
| 188 | // Perform the feature estimation |
| 189 | pcl::PCLPointCloud2 output; |
| 190 | compute (cloud, output, max_it, thresh, negative); |
| 191 | |
| 192 | // Prepare output file name |
| 193 | std::string filename = pcl_fs::path(pcd_file).filename().string(); |
| 194 | |
| 195 | // Save into the second file |
| 196 | const std::string filepath = output_dir + '/' + filename; |
| 197 | saveCloud (filepath, output); |
| 198 | } |
| 199 | return (0); |
| 200 | } |
| 201 | |
| 202 | /* ---[ */ |
| 203 | int |