| 137 | } |
| 138 | |
| 139 | int |
| 140 | batchProcess (const std::vector<std::string> &pcd_files, std::string &output_dir, |
| 141 | float resolution, const std::string &method) |
| 142 | { |
| 143 | for (const auto &pcd_file : pcd_files) |
| 144 | { |
| 145 | // Load the first file |
| 146 | Cloud::Ptr cloud (new Cloud); |
| 147 | if (!loadCloud (pcd_file, *cloud)) |
| 148 | return (-1); |
| 149 | |
| 150 | // Perform the feature estimation |
| 151 | Cloud output; |
| 152 | compute (cloud, output, resolution, method); |
| 153 | |
| 154 | // Prepare output file name |
| 155 | std::string filename = pcl_fs::path(pcd_file).filename().string(); |
| 156 | |
| 157 | // Save into the second file |
| 158 | const std::string filepath = output_dir + '/' + filename; |
| 159 | saveCloud (filepath, output); |
| 160 | } |
| 161 | return (0); |
| 162 | } |
| 163 | |
| 164 | |
| 165 | /* ---[ */ |