@@ -13,7 +13,7 @@ use num_traits::{Float, One, Zero};
1313use std:: fmt:: Debug ;
1414
1515/// Contains all the correspondences found by the correspondence estimator.
16- pub struct Correspondences < ' a , T , const D : usize >
16+ pub struct Correspondences < ' a , ' t , T , const D : usize >
1717where
1818 T : Copy + PartialEq + Debug + ' static ,
1919{
@@ -22,12 +22,12 @@ where
2222 pub alignee_point_cloud : MaskedPointCloud < ' a , T , D > ,
2323
2424 /// Every point in this iterator corresponds to the point in the `alignee_point_cloud` with the same index.
25- pub corresponding_target_point_cloud : MaskedPointCloud < ' a , T , D > ,
25+ pub corresponding_target_point_cloud : MaskedPointCloud < ' t , T , D > ,
2626
2727 /// Iterator over the points of the target that have a corresponcence point in the alignee.
2828 /// (found in the `corresponding_alignee_point_cloud`).
2929 /// This is only used by bidrectional distance correspondence estimators.
30- pub target_point_cloud : MaskedPointCloud < ' a , T , D > ,
30+ pub target_point_cloud : MaskedPointCloud < ' t , T , D > ,
3131
3232 /// Every point in this iterator corresponds to the point in the `target_point_cloud` with the same index.
3333 /// This is only used by bidrectional distance correspondence estimators.
@@ -43,15 +43,16 @@ where
4343 pub target_to_alignee_distances : Vec < T > ,
4444}
4545
46- impl < ' a , T , const D : usize > Correspondences < ' a , T , D >
46+ impl < ' a , ' t , T , const D : usize > Correspondences < ' a , ' t , T , D >
4747where
4848 T : Copy + PartialEq + Debug + ' static ,
49+ ' a : ' t ,
4950{
5051 /// Use this for simple one-way correspondence estimators.
5152 pub fn from_simple_one_way_correspondences (
5253 alignee_point_cloud : MaskedPointCloud < ' a , T , D > ,
5354 alignee : & ' a PointCloud < T , D > ,
54- corresponding_target_point_cloud : MaskedPointCloud < ' a , T , D > ,
55+ corresponding_target_point_cloud : MaskedPointCloud < ' t , T , D > ,
5556 alignee_to_target_distances : Vec < T > ,
5657 ) -> Self {
5758 let mut empty_alignee_cloud = MaskedPointCloud :: new ( alignee) ;
@@ -90,29 +91,30 @@ where
9091 /// It takes a reference to a `PointCloudPoint` and returns a boolean which is `true` if the point should be included.
9192 ///
9293 /// See the [`Correspondences`] return type documentation for more information.
93- fn find_correspondences < ' b , FP > (
94- & self ,
94+ fn find_correspondences < ' b , ' t , FP > (
95+ & ' t self ,
9596 alignee : & ' b PointCloud < T , D > ,
9697 target : & ' b TG ,
9798 filter_points : & mut FP ,
98- ) -> Correspondences < ' b , T , D >
99+ ) -> Correspondences < ' b , ' t , T , D >
99100 where
100- FP : FnMut ( & PointCloudPoint < T , 3 > ) -> bool ;
101+ FP : FnMut ( & PointCloudPoint < T , 3 > ) -> bool ,
102+ ' b : ' t ;
101103}
102104
103105/// For every point in `data_set_x` finds the nearest point in `data_set_y` using the KD-Tree `tree`.
104106/// Returns a masked point_cloud referencing `data_set_x` that contains all points allowed by `filter_points`
105107/// and another masked point_cloud referencing `data_set_y` that correspond to the points in the first
106108/// returned masked point_cloud.
107109/// Finally it returns a list of the distances between the points of the two returned point_clouds.
108- pub fn get_ordered_correspondences_and_distances_nn < ' a , T , FP > (
109- tree : & KdTree < T , usize , & [ T ] > ,
110+ pub fn get_ordered_correspondences_and_distances_nn < ' a , ' t , T , FP > (
111+ tree : & KdTree < T , usize , Vec < T > > ,
110112 data_set_x : & ' a PointCloud < T , 3 > ,
111- data_set_y : & ' a PointCloud < T , 3 > ,
113+ data_set_y : & ' t PointCloud < T , 3 > ,
112114 filter_points : & mut FP ,
113115) -> (
114116 MaskedPointCloud < ' a , T , 3 > ,
115- MaskedPointCloud < ' a , T , 3 > ,
117+ MaskedPointCloud < ' t , T , 3 > ,
116118 Vec < T > ,
117119)
118120where
0 commit comments