---[ */
| 125 | |
| 126 | /* ---[ */ |
| 127 | int |
| 128 | main (int argc, char** argv) |
| 129 | { |
| 130 | print_info ("Compute Hausdorff distance between point clouds. For more information, use: %s -h\n", argv[0]); |
| 131 | |
| 132 | if (argc < 3) |
| 133 | { |
| 134 | printHelp (argc, argv); |
| 135 | return (-1); |
| 136 | } |
| 137 | |
| 138 | // Parse the command line arguments for .pcd files |
| 139 | std::vector<int> p_file_indices; |
| 140 | p_file_indices = parse_file_extension_argument (argc, argv, ".pcd"); |
| 141 | if (p_file_indices.size () != 2) |
| 142 | { |
| 143 | print_error ("Need two PCD files to compute Hausdorff distance.\n"); |
| 144 | return (-1); |
| 145 | } |
| 146 | |
| 147 | // Load the first file |
| 148 | Cloud::Ptr cloud_a (new Cloud); |
| 149 | if (!loadCloud (argv[p_file_indices[0]], *cloud_a)) |
| 150 | return (-1); |
| 151 | |
| 152 | // Load the second file |
| 153 | Cloud::Ptr cloud_b (new Cloud); |
| 154 | if (!loadCloud (argv[p_file_indices[1]], *cloud_b)) |
| 155 | return (-1); |
| 156 | |
| 157 | // Compute the Hausdorff distance |
| 158 | compute (cloud_a, cloud_b); |
| 159 | } |
| 160 |