kzampog / cilantro

A lean C++ library for working with point cloud data
MIT License
1.01k stars 206 forks source link

Feature/knn in radius correspondences #39

Closed wannesvanloock closed 4 years ago

wannesvanloock commented 4 years ago

This PR proposes to use kNNInRadius neighbors instead nearest neighbors. I haven't tested it through but an ICP run seems to be around 30-40% faster.

There is a slight shortcut here in the fact that we pass max_distance as max radius for the search. Before max_distance was only used after applying evaluator to the correspondence.

kzampog commented 4 years ago

Awesome! The shortcut should be valid if the evaluator distance is greater than the kd-tree distance. I think most common cases can be adapted to this, so there shouldn't be a significant loss of generality. Otherwise, we could pass an extra argument for the search radius, but that would probably overcomplicate the API.

kzampog commented 4 years ago

Getting ~120ms down from ~170ms for the rigid_icp example on the test cloud on an eight-core machine!