---[ */
| 127 | |
| 128 | /* ---[ */ |
| 129 | int |
| 130 | main (int argc, char** argv) |
| 131 | { |
| 132 | print_info ("Bilateral Filter Upsampling of an organized point cloud containing color information. For more information, use: %s -h\n", argv[0]); |
| 133 | |
| 134 | if (argc < 3) |
| 135 | { |
| 136 | printHelp (argc, argv); |
| 137 | return (-1); |
| 138 | } |
| 139 | |
| 140 | // Parse the command line arguments for .pcd files |
| 141 | std::vector<int> p_file_indices; |
| 142 | p_file_indices = parse_file_extension_argument (argc, argv, ".pcd"); |
| 143 | if (p_file_indices.size () != 2) |
| 144 | { |
| 145 | print_error ("Need one input PCD file and one output PCD file to continue.\n"); |
| 146 | return (-1); |
| 147 | } |
| 148 | |
| 149 | // Command line parsing |
| 150 | int window_size = default_window_size; |
| 151 | double sigma_color = default_sigma_color; |
| 152 | double sigma_depth = default_sigma_depth; |
| 153 | |
| 154 | parse_argument (argc, argv, "-window_size", window_size); |
| 155 | parse_argument (argc, argv, "-sigma_color", sigma_color); |
| 156 | parse_argument (argc, argv, "-sigma_depth", sigma_depth); |
| 157 | |
| 158 | // Load the first file |
| 159 | pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); |
| 160 | if (!loadCloud (argv[p_file_indices[0]], *cloud)) |
| 161 | return (-1); |
| 162 | |
| 163 | // Do the smoothing |
| 164 | pcl::PCLPointCloud2 output; |
| 165 | compute (cloud, output, window_size, sigma_color, sigma_depth); |
| 166 | |
| 167 | // Save into the second file |
| 168 | saveCloud (argv[p_file_indices[1]], output); |
| 169 | } |