WIP: Point to Plane ICP#3899
Conversation
|
CC @ntustison |
|
Thanks @PranjalSahu for kicking this off — point-to-plane ICP is a real gap in ITK and the structural choices in this PR (per-point normals via PixelType, integration with the v4 metric framework, multithreaded accumulation) are the right shape. The PR has been dormant for ~3 years without a primary driver, so we're closing it on grounds of inactivity and consolidating findings here so a future contributor can pick this up cold. Findings from a 2026-05-10 algorithmic reviewThe current implementation has three correctness issues that mean it needs a rewrite (not a patch) before merging. Documenting them so the next attempt doesn't repeat them. Bug 1 — element-wise multiply where dot-product is neededIn localDerivative = closestPoint - point;
for (int i = 0; i < pixel.Size(); ++i)
{
localDerivative[i] = localDerivative[i] * pixel[i]; // element-wise — wrong
}The correct per-point gradient direction is Correct form: MeasureType e = 0;
for (unsigned int d = 0; d < PointDimension; ++d) e += (point[d] - closestPoint[d]) * pixel[d];
for (unsigned int d = 0; d < PointDimension; ++d) localDerivative[d] = -e * pixel[d];Bug 2 — hard-coded 2D in the parameter-space chain ruleIn threadLocalTransformDerivative[par] += new_jacobian[par] * (pointDerivative[0] + pointDerivative[1]);
The fix is to not override Bug 3 — modifies the shared base class instead of overridingThe PR edits The base class should be left untouched. All point-to-plane-specific behavior belongs in the new Reference math (canonical)
Reference: K.-L. Low, "Linear Least-Squares Optimization for Point-to-Plane ICP Surface Registration", UNC TR04-004 (2004). Cross-checked against:
VTK's Hints for a future driverA working draft for a fresh-start takeover lived briefly at
Discourse motivationMultiple Discourse threads have asked for surface-to-surface ICP capability that point-to-plane addresses (faster convergence than point-to-point on smooth surfaces):
The functional motivation is solid; this PR is closed only because it stalled without a champion. Reopening or starting fresh against a new ITK base is encouraged when someone has the bandwidth to drive it through review. Closing on grounds of inactivity (3+ years, WIP, no primary driver). Thanks again @PranjalSahu — the structural pattern, the FPFH/RANSAC remote modules, and the |
|
I have access to AI agents now and using the review comments I have created some changes. I will check them more for correctness and will create a new PR. |
This is a work-in-progress PR for Point to Plane ICP.
It requires the per-point normal and the Jacobian computation is different compared to Point to Point.
Idea here is to store the normal as data for each point and then use it while calculating Jacobian.
Some references for the implementation:
https://github.com/niosus/notebooks/blob/master/icp.ipynb
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.