
1. Point-to-Point and Point-to-Plane ICP
1.1 Point-to-Point ICP
Mathematically, we are searching for the optimal transformation matrix T^*:

1.2 Point-to-Plane ICP
In Point-to-Plane ICP, we change the rules of the geometry. Instead of forcing a source point to match a specific target point, we force the source point to lie on the flat plane defined by the target point. The error is calculated by projecting the distance vector onto the normal vector using a dot product:

This allows the optimization to beautifully "slide" point clouds along feature surfaces until corners and edges lock them into place, completely bypassing the fact that the LiDAR lasers didn't hit the exact same physical spots.
2. Normal Distributions Transform (NDT)
Instead of treating the target map as a rigid collection of millions of distinct dots, NDT compresses the map into a smooth, continuous probability density function (PDF).
2.1 Building the NDT Map (Probability Density Representation)
Before any scan-matching occurs, we must convert our target point cloud T into an NDT map.
Just like in spatial downsampling, we divide 3D space into a grid of voxels. However, instead of computing a single centroid for each voxel, we compute the statistical distribution of all points inside it.
Step 2: Mean and Covariance
For a specific voxel containing N points {y_1, ..., y_N}, we calculate the 3D mean vector and the 3x3 covariance matrix:


Step 3: The Gaussian PDF
These two parameters define a 3D Gaussian (Normal) distribution. The probability of measuring a point at any arbitrary spatial location x within that voxel is given by the multivariate normal probability density function:

2.2 The NDT Score Function
We figure out which voxel x_i lands in, and evaluate the PDF p(x_i) for that voxel. Our goal is to maximize the sum of all these probabilities, the NDT Score (s):

Summary
1. ICP (Geometric Optimization): Relies on explicit data association between source and target clouds. While the naive Point-to-Point method often struggles with local minima, the industry-standard Point-to-Plane approach minimizes error along surface normals. This allows the point clouds to mathematically "slide" along flat planes until corners and edges lock into the correct alignment.
2. NDT (Statistical Optimization): Bypasses the computationally expensive point-matching step of ICP entirely. It voxelizes the target cloud and computes the mean and covariance for each grid space, transforming the map into a continuous probability density function (PDF). The algorithm then aligns the source cloud by finding the transformation that maximizes the statistical probability (the NDT Score) of the points landing within these Gaussian distributions.
Ultimately, while ICP achieves alignment by minimizing geometric distances, NDT accomplishes the same goal by maximizing statistical probabilities.