Algorithm - kpmoorse/sim_reg GitHub Wiki

Core Algorithm for Naive ICP

  • Repeat until convergence:
    • Estimate correspondence via nearest neighbor search
    • Estimate transform between point clouds via linear regression
    • Apply transform to model
  • Return estimated transform
Naive ICP demo Linear Transform eqn1

Linear Transform eqn2

Model (M) and Scene (S) are represented as Nx3 matrices, where each row represents a point in R2, with unity appended to allow for offsets (translations) in the estimated transform (T). Normally, finding T via linear regression could be done more easily using a built-in function, but the matrix formulation shown above will be important for the extensions which will be proposed below.

Motivation for Weighted Least Squares

For neural data, robust methods exist to extract individual neuron footprints via either image segmentation or functional correlation. However, basic registration methods like naive ICP often fail to converge to the desired solution due to the roughly periodic (hex-packed) structure of the data, which regularly causes "off-by-one" errors.

Real Model Image Real Scene Image Overlaid Point Clouds

By inserting a diagonal weight matrix into the Naive ICP formulation, we gain an extra degree of freedom which can be used to guide the algorithm away from the local minima associated with "off-by-one" errors.

Weighted Least Squares Formulation

Weighting by Image Similarity

When the original images are reduced to point clouds for registration, all of the image information is wasted. Rather than throwing that data away, we can instead use it to generate similarity values which can be used to populate the weight matrix. First, we extract a uniform ROI of image data around each neuron centroid and decompose it into its Zernike moments, which have the desirable properties of being orthogonal and rotation-invariant.

Zernike moment demo

Then, for each pair of estimated corresponding points, we generate a "similarity" value between the two vectors of Zernike moments. There are many principled ways of generating this value, including mutual information, but we use a simple correlation metric from signal processing here because it is intuitive and effective.

Zernike moment plot Correlation
Signal processing correlation

Mutual Information
Mutual Information

Trimmed Least Squares

Naive ICP implicitly assumes that the Model point cloud corresponds to a subset of the Scene (M⊆S), which is often untrue for real data. To force the validity of the assumption, we provide the algorithm with ξ ∈ (0,1), the a priori "minimum overlap" between M and S, and only the floor(ξNModel) correspondences with least Euclidean distance are used for each iteration.

Duplicate Culling

It is common that more than one point in the Model is assigned correspondence to the same point in the Scene. In this case, we want to apply post-processing to remove erroneous points from the final correspondence vector. Unfortunately, it is not generally the case that correct and erroneous points are separable by Zernike similarity value--that is, there is no similarity threshold at which we are confident that higher values are correct and lower values are incorrect.

Signal processing correlation

However, it is generally the case that when duplicate correspondences are compared, the one with the highest similarity value is the true correspondence. So, we cull all correspondences for which there exists a better correspondence to the same Scene point.

Signal processing correlation

Algorithm for Similarity-Weighted ICP (Changes in bold)

  • Repeat until convergence:
    • Estimate correspondence via nearest neighbor search
    • Calculate weights via correlation of Zernike moment vectors
    • Generate trimmed point clouds
    • Estimate transform between point clouds via weighted, trimmed linear regression
    • Apply transform to model
  • Remove points with duplicate correspondences
  • Return estimated correspondences
⚠️ **GitHub.com Fallback** ⚠️