Search code examples
c++kinectpoint-cloud-librarypoint-clouds

PCL 3D object recognition based on correspondance grouping parameters


I implemented 3D object recognition based on correspondance grouping but I am unable to deal with proper algorithm parameters to find an object on the scene.

Following example works good with provided milk and scene pcds.

http://www.pointclouds.org/documentation/tutorials/correspondence_grouping.php

but not with my example object and scene. Then, current tried parameters are,

//Algorithm params
    bool show_keypoints_(true);
    bool show_correspondences_(false);
    bool use_cloud_resolution_(false); 
    bool use_hough_(true);
    float model_ss_(0.01f); 
    float scene_ss_(0.0125f); 
    float rf_rad_(0.008f); 
    float descr_rad_(0.008f);
    float cg_size_(0.05f); 
    float cg_thresh_(5.0f);

and model and scene files,

https://www.dropbox.com/s/0o8igpbfnqu5vk3/model.pcd?dl=0 https://www.dropbox.com/s/pv5re3iqzsme29j/scene.pcd?dl=0

How to deal with proper parameters without doing test/error?


Solution

  • In general, it is very difficult, if not outright impossible, to choose the “correct”, or in any way “best”, parameters for a detection problem, without at least running some informal experiments on your available training data.

    Ideally, you should have a set of labeled test images and a way of automatically testing your object recognition approach on your dataset, outputting helpful measures such as the detection precision and recall, or the mean squared error of the estimated object pose versus your known ground truth. Then, you could script your program to explore the parameter space, starting from some reasonable-looking initial parameter values.

    As for your concrete example, the best I can offer are the following observations:

    • In order to test that your implementation works at all, I recommend recording an “easier” scene image. Compared to the sample image in the PCL tutorial, your scene looks much more difficult to interpret (it took me a while to actually find your model myself). For example:
      • Try cropping the scene to the relevant area.
      • Place the object by itself on a bigger, otherwise empty surface.
      • Maybe place the sensor closer to the object.
      • Place the object at a slight angle to the sensor, and record the image from a bit above the object, so that more of it is visible in the image.
    • I would choose more complex scenes only once you have mastered the basic one.
    • The parameter values used in the tutorial look like a good starting point, since your scene and model appear to be roughly the same size and of similar shape. For example, I would expect that the uniform sampling radius parameters should be OK for you as well.
    • Your model appears to be quite smooth. This could have an effect on keypoint extraction and descriptor calculation. You may need to adjust your cluster size and descriptor radius (to bigger values), and the clustering threshold. You should visualize the extracted keypoints to see if they make sense. Are there enough keypoints? Do they lie at meaningful salient locations on the surfaces? Do you get keypoints at corresponding locations between the model and the scene? This part you can adjust independent of the other parameters.