Iterative Closest Point (ICP) Algorithm
Point Cloud Registration
Point cloud registration is the process of aligning two or more 3D point clouds of the same scene that have been captured from different viewpoints. Given a source point cloud, which we can call
The ICP Algorithm
We don't know which point in the source cloud corresponds to which point in the target cloud. ICP algorithm provides an elegant solution to this by a simple heuristic: it assumes that, for a given point in the source cloud, its nearest neighbor in the target cloud is its correct correspondence. While this assumption is not always true, especially at the beginning, it becomes increasingly accurate as the clouds get closer to alignment.
The algorithm is an iterative process that can be broken down into four steps:
- Initial Guess: The process begins with an initial estimate for the transformation,
. This initial guess can come from other sensors, like an Inertial Measurement Unit (IMU), or from the result of the previous alignment between a different pair of scans. A good initial guess is very crucial for convergence. - Data Association: For each point in the source cloud, its nearest point in the target cloud is found. This establishes a set of tentative correspondences.
- Optimize Transformation: With these correspondences established, the algorithm then computes the optimal transformation
that minimizes a cost function, which typically is the sum of squared distances between these associated pairs. - Iterate: The newly computed transformation is applied to the source point cloud. Steps 2 and 3 are then repeated with this updated point cloud. This loop continues until the algorithm converges, which is usually checked by checking if the change in the error between iterations falls below decided threshold.
The Optimization Step: A Closed-Form Solution
For a given set of point correspondences, step 3 of the ICP algorithm has a closed-form analytical solution. This method, often called the Kabsch algorithm, finds the optimal rotation and translation by minimizing the following least-squares cost function:
Here,
- Solving for Translation: First, the optimal translation is found by recognizing that it must align the centroids (or geometric means) of the two point sets.
Derivation for optimal translation,
We start with the cost function,
Find minimum wrt
We can then solve for
Dividing by
The optimal translation,
where
This is also pretty intuitive as
- Solving for Rotation: By substituting this expression for
back into the original cost function, the problem simplifies to finding the optimal rotation for the centered point clouds.( Think how PCA works here , PC1 is calculated by first centering the data, then finding the direction of maximum variance, just a random thought can be ignored for reading the proof)
Derivation for optimal rotation,
Substitute
Let
Expanding the squared norm:
Since rotation preserves length,
The terms
where
The term
This is solved using Singular Value Decomposition (SVD). We first construct a
Next, we compute the SVD of this matrix:
The optimal rotation matrix,
It is important to ensure that the resulting matrix is a proper rotation and not a reflection, which can happen in noisy or degenerate cases. This is checked by ensuring its determinant is +1. A correction can be applied if necessary:
Wrapping Up
At this point, we’ve got everything we need ladies and gentleman.
The ICP loop boils down to finding correspondences, then solving for the rigid transform using the closed-form Kabsch solution:
where
Applications
fir kabhi 🙏🏻🙏🏻🙏🏻🙏🏻
ICP-SLAM
**