Function mapping_algorithms::icp::icp_iteration

source ·
pub fn icp_iteration<T, const N: usize>(
    points_a: &[Point<T, N>],
    transformed_points: &mut [Point<T, N>],
    points_b: &[Point<T, N>],
    target_points_tree: Option<&KDTree<T, N>>,
    current_transform: &mut Isometry<T, <IsometryAbstractor<T, N> as AbstractIsometry<T, N>>::RotType, N>,
    current_mse: &mut T,
    config: &ICPConfiguration<T>,
) -> Result<T, (Point<T, N>, Point<T, N>)>
Expand description

A single iteration of the ICP function, allowing for any input and output, usually used for debugging or visualization

§Arguments

  • points_a: A slice of Point, representing the source point cloud.
  • transformed_points: A mutable slice of Point, representing the transformed source point cloud, this will be transformed further by the function.
  • points_b: A slice of Point, representing the target point cloud.
  • target_points_tree: An Option<KDTree<T, N>>, this is usually created by the ICP function if config.use_kd is true
  • current_transform: A mutable reference to the Isometry used to transform the source points, this will gradually change with each iteration.
  • current_mse: A mutable reference of a T, this will be updated by the function to the latest MSE, which is then used by the ICP function to determine an exit strategy.
  • config: a reference to an ICPConfiguration, specifying the behaviour of the algorithm.

§Generics

§Returns

An ICPSuccess struct with an Isometry transform with a T precision, or an error message explaining what went wrong.


  1. This does not guarantee that the transformation is correct, only that no further benefit can be gained by running another iteration.