File Exchange

image thumbnail

Optimal Step Nonrigid ICP

version (7.54 MB) by Charlie Nash
Matlab implementation of non-rigid iterative closest point


Updated 04 Apr 2018

GitHub view license on GitHub

Optimal Step Nonrigid ICP is a MATLAB implementation of a non-rigid variant of the iterative closest point algorithm. It can be used to register 3D surfaces. The method is described in the following paper:
'Optimal Step Nonrigid ICP Algorithms for Surface Registration', Amberg, Romandhani and Vetter, CVPR, 2007.
* Non-rigid and local deformations of a template surface or point cloud.
* Iterative stiffness reduction allows for global intitial transformations that become increasingly localised.
* Optional initial rigid registration using standard iterative closest point.
* Optional bi-directional distance metric which encourages surface deformations to cover more of the target surface.
* Handles missing data in the target surface by ignoring correspondences with points on target edges.

Cite As

Charlie Nash (2020). Optimal Step Nonrigid ICP (, GitHub. Retrieved .

Comments and Ratings (17)

Alessandro Borghi

my only question is: in the sample data, each mesh has a number of normals which is equal to the number of nodes as opposed to the number of faces. Shouldn't it be the other way round? the code - to work using normals - seems to only work under this condition

Peixin Li


How to use this for point cloud registration ?

if anyone has a solution for my question please write me:

Steven Lewis

Is there a video, or tutorial on how to use this, or at least directions on how to? Can this be used on a mesh of faces and vertices, or do you have to alter it to a point cloud?

Chaitanya Patel

How to use this for point cloud registration ?

James Farrell

Rui Gu

Sheon yan


Awesome code , Thank you :)



anusha gorrila

Hello Charlie, Thanks for the code. I run this code again my 2 stl files, with 10,000 * 3 faces and 30000 * 3 vertices, but I get an error which is Index exceeds Matrix Dimensions at Line 213 ie.,
Error in nricp (line 213)
N(j,(4 * j-3):(4 * j)) = [normalsSource(j,:) 1];

can you please guide me on how to resolve this?

Thanks in advance!


Hi, Does it work on point cloud data? And do we need Matlab 2015b ?

feng liu

Hi Charlie.When I tried to align my data, the inner loop did not stop. Could you please tell me what should I do to with this problem.

btw, excellent code! thank you very much! It's really inspiring!

Charlie Nash

Hi Xiaolong, the method is best described in the paper:

'Optimal Step Nonrigid ICP Algorithms for Surface Registration', Amberg, Romandhani and Vetter, CVPR, 2007.

It seems to be freely available here:

Xiaolong Zhang

Hi Charlie.It's a wonderful code, but could you please provide a detailed documentation(or any link) which explains the code.Thank you very much!

YanFei Gao


Bug fix in nricp.m

Now handles missing target surface data by ignoring correspondences to points lying on edge of target. Added option to reject correspondences where surface normals are not close. Added demo for missing data.

Name change.

More minor formatting changes.

Minor formatting changes.

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Toolbox Graph, geom3d, Iterative Closest Point