| 115 | } |
| 116 | |
| 117 | int |
| 118 | batchProcess (const std::vector<std::string> &pcd_files, std::string &output_dir, |
| 119 | float resolution) |
| 120 | { |
| 121 | for (const auto &pcd_file : pcd_files) |
| 122 | { |
| 123 | // Load the first file |
| 124 | Cloud::Ptr cloud (new Cloud); |
| 125 | if (!loadCloud (pcd_file, *cloud)) |
| 126 | return (-1); |
| 127 | |
| 128 | // Perform the feature estimation |
| 129 | Cloud output; |
| 130 | compute (cloud, output, resolution); |
| 131 | |
| 132 | // Prepare output file name |
| 133 | std::string filename = pcl_fs::path(pcd_file).filename().string(); |
| 134 | |
| 135 | // Save into the second file |
| 136 | const std::string filepath = output_dir + '/' + filename; |
| 137 | saveCloud (filepath, output); |
| 138 | } |
| 139 | return (0); |
| 140 | } |
| 141 | |
| 142 | |
| 143 | /* ---[ */ |