Project based on the tutorial found at PointClouds.org
-
Download the pcd data from Github and extract files in a folder of your convenience.
-
Download the repository by clicking here
-
Uncompress the archive
-
Move to the uncompressed directory, and create a build directory in there:
$ cd path/to/CorrespondenceGrouping-<branch> && mkdir build && cd build
-
Run the Cmake build system using the default options:
$ cmake ..
Or change them:
$ cmake -DCMAKE_BUILD_TYPE=Release ..
-
Compile everything:
$ make
-
After you have created the executable, you can then launch it following this example:
$ ./CorresponseGrouping milk.pcd milk_cartoon_all_small_clorox.pcd
Or alternatively, if you prefer specifying the radii in units of cloud resolution:
$ ./correspondence_grouping milk.pcd milk_cartoon_all_small_clorox.pcd milk.pcd milk_cartoon_all_small_clorox.pcd -r --model_ss 7.5 --scene_ss 20 --rf_rad 10 --descr_rad 15 --cg_size 10
Remember to replace milk.pcd and milk_cartoon_all_small_clorox.pcd with model and scene filenames, in this exact order. If you want you can add other command line options as described at the beginning of this tutorial.
After a few seconds, you will see an output similar to:
Model total points: 12575; Selected Keypoints: 686
Scene total points: 307200; Selected Keypoints: 3747
Correspondences found: 1777
Model instances found: 1
Instance 1:
Correspondences belonging to this instance: 21
| 0.968 -0.127 0.218 |
R = | 0.124 0.992 0.031 |
| -0.220 -0.003 0.975 |
t = < -0.158, 0.215, -0.042 >
The output window should look like this (depending on the command line options used):
It’s important to say that the only command line parameters required when executing this tutorial are the filenames of the model and the scene, in this exact order. All other parameters are set to a default value that will make the tutorial work correctly with the supplied dataset, although with different models and scene some parameter values might need to be adjusted. You can play around with them to see how they influence the final result.
You can choose between two correspondence clustering algorithms with the command line switch --algorithm (Hough|GC)
-
Hough (default)
This is a clustering algorithm based on a 3D Hough voting scheme described in:
-
GC
This is a geometric consistency clustering algorithm enforcing simple geometric constraints between pairs of correspondences. It builds on the proposal presented in:
Some other interesting switches are -k, -c and -r:
- -k shows the keypoints used to compute the correspondences as a blue overlay into the PCL visualizer.
- -c draws a line connecting each pair of model-scene correspondences that survived the clustering process.
- -r estimates the spatial resolution for the model point cloud and afterwards considers the radii used as parameters as if they were given in units of cloud resolution; thus achieving some sort of resolution invariance that might be useful when using this tutorial with the same command line and different point clouds.
-
The CMakeLists.txt has been edited in order to let make correctly link and build on Mac OS X 10.9
-
If you are using different point clouds and you don’t know how to set the various parameters for this tutorial you can use the -r flag and try setting the LRF and descriptor radii to 5, 10, 15 or 20 times the actual cloud resolution. After that you probably will have to tweak the values by hand to achieve the best results.