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>)>where
T: Bounded + Copy + Default + RealField + Sum + SimdRealField,
usize: AsPrimitive<T>,
IsometryAbstractor<T, N>: AbstractIsometry<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 ofPoint, representing the source point cloud.transformed_points: A mutable slice ofPoint, representing the transformed source point cloud, this will be transformed further by the function.points_b: A slice ofPoint, representing the target point cloud.target_points_tree: AnOption<KDTree<T, N>>, this is usually created by the ICP function ifconfig.use_kdistruecurrent_transform: A mutable reference to theIsometryused to transform the source points, this will gradually change with each iteration.current_mse: A mutable reference of aT, 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 anICPConfiguration, specifying the behaviour of the algorithm.
§Generics
T: Eitherf32orf64.R: Either aUnitComplexor aUnitQuaternionofT, depednding onN.N: a usize, either2or3.
§Returns
An ICPSuccess struct with an Isometry transform with a T precision, or an error message explaining what went wrong.
This does not guarantee that the transformation is correct, only that no further benefit can be gained by running another iteration. ↩