isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.23k stars 2.28k forks source link

Expose registration.GetRegistrationResultAndCorrespondences #6315

Open yosho27 opened 1 year ago

yosho27 commented 1 year ago

Checklist

Proposed new feature or change

Performing several ICP registrations or evaluations with the same target point cloud can become very time consuming. However, a significant portion, and in some cases the overwhelming majority, of this time seems to be spent on recreating the target point cloud's KDTree on each call to Open3D's registration. In this cases I could significantly reduce my runtime by reusing the same KDTree for all of these operations. I believe the simplest way to make this possible in Open3D would be to expose the function GetRegistrationResultAndCorrespondences to the Python API. This would also allow developers to create custom ICP loops with custom transformations and stopping conditions or run more involved evaluations without requiring the runtime of generating the KDTree. This function could essentially act as a batched called to search_knn_vector_3d with a set of many starting points (in a more generic form that allows k>1, such a function could have many versatile uses, such as custom computations of point attributes like normal vectors or curvature using numpy functions instead of Python loops). Thank you

References

No response

Additional information

No response

theNded commented 1 year ago

Proposed new feature or change

Performing several ICP registrations or evaluations with the same target point cloud can become very time consuming. However, a significant portion, and in some cases the overwhelming majority, of this time seems to be spent on recreating the target point cloud's KDTree on each call to Open3D's registration.

I don't quite get the context, maybe you are talking about other implementations. FYI, in Open3D, KDTree is initialized here and reused in each iteration here.

In this cases I could significantly reduce my runtime by reusing the same KDTree for all of these operations. I believe the simplest way to make this possible in Open3D would be to expose the function GetRegistrationResultAndCorrespondences to the Python API. This would also allow developers to create custom ICP loops with custom transformations and stopping conditions or run more involved evaluations without requiring the runtime of generating the KDTree.

In the latest API, we do have a call back function after each loop: http://www.open3d.org/docs/release/python_api/open3d.t.pipelines.registration.icp.html#open3d-t-pipelines-registration-icp

This function could essentially act as a batched called to search_knn_vector_3d with a set of many starting points (in a more generic form that allows k>1, such a function could have many versatile uses, such as custom computations of point attributes like normal vectors or curvature using numpy functions instead of Python loops). Thank you

Overall I think the fundamental requirement is a batch knn-search. I agree this is an important feature to pursue. I believe providing a batch knn search is a more modularized way than exposing GetRegistrationResultAndCorrespondences itself. I will work on it.