#translation #scaling #algorithm #point #pair #similarity #rotation

kabsch_umeyama

The Kabsch-Umeyama algorithm is a method for aligning and comparing the similarity between two sets of points. It finds the optimal translation, rotation and scaling by minimizing the root-mean-square deviation (RMSD) of the point pairs.

3 releases

new 0.1.2 Nov 16, 2024
0.1.1 Nov 15, 2024
0.1.0 Nov 15, 2024

#541 in Algorithms

Download history 249/week @ 2024-11-10

251 downloads per month

Apache-2.0

9KB
127 lines

Kabsch-Umeyama   Build Status Latest Version

The Kabsch-Umeyama algorithm is a method for aligning and comparing the similarity between two sets of points. It finds the optimal translation, rotation and scaling by minimizing the root-mean-square deviation (RMSD) of the point pairs.


Features

  • Efficient and accurate implementation of the Kabsch-Umeyama algorithm.
  • Calculates translation, and (optional) scaling matrices (RxC dimensions).
  • Suitable for various applications involving point cloud alignment.

Dependency

If you have Ubuntu, follow the command below:

sudo apt install gfortran cmake

If you encounter an error, please check the requirements at nalgebra-lapack


Examples

use kabsch_umeyama::{Array2, estimate};

fn main() {
    // create an array src with 2 rows and 3 columns from a nested array
    let src = Array2::from([[1., 2., 3.], [4., 5., 6.]]);

    // create a dst array with 2 rows and 3 columns from a reference array
    let dst = Array2::<2, 3>::from(&[2., 3., 4., 5., 6., 7.]);
    
    // estimate the translation matrix
    let t = estimate(src, dst, true);
    println!("The homogeneous similarity transformation matrix is: {}", t);
}

References

Dependencies

~63MB
~838K SLoC