@@ -231,7 +231,7 @@ pub fn brief(
231231 } else {
232232 // generate a set of test pairs within a 31x31 grid with a Gaussian bias (sigma = 6.6)
233233 let test_pair_distribution = Normal :: new ( BRIEF_PATCH_RADIUS as f32 + 1.0 , 6.6 ) . unwrap ( ) ;
234- let mut rng = rand:: thread_rng ( ) ;
234+ let mut rng = rand:: rng ( ) ;
235235 let mut test_pairs: Vec < TestPair > = Vec :: with_capacity ( length) ;
236236 while test_pairs. len ( ) < length {
237237 let ( x0, y0, x1, y1) = (
@@ -330,12 +330,12 @@ mod benches {
330330 #[ ignore]
331331 fn bench_brief_random_test_pairs_1000_keypoints ( b : & mut Bencher ) {
332332 let image = gray_bench_image ( 640 , 480 ) ;
333- let mut rng = rand:: thread_rng ( ) ;
333+ let mut rng = rand:: rng ( ) ;
334334 let keypoints = ( 0 ..1000 )
335335 . map ( |_| {
336336 Point :: new (
337- rng. gen_range ( 24 ..image. width ( ) - 24 ) ,
338- rng. gen_range ( 24 ..image. height ( ) - 24 ) ,
337+ rng. random_range ( 24 ..image. width ( ) - 24 ) ,
338+ rng. random_range ( 24 ..image. height ( ) - 24 ) ,
339339 )
340340 } )
341341 . collect :: < Vec < Point < u32 > > > ( ) ;
@@ -348,12 +348,12 @@ mod benches {
348348 #[ ignore]
349349 fn bench_brief_fixed_test_pairs_1000_keypoints ( b : & mut Bencher ) {
350350 let image = gray_bench_image ( 640 , 480 ) ;
351- let mut rng = rand:: thread_rng ( ) ;
351+ let mut rng = rand:: rng ( ) ;
352352 let keypoints = ( 0 ..1000 )
353353 . map ( |_| {
354354 Point :: new (
355- rng. gen_range ( 24 ..image. width ( ) - 24 ) ,
356- rng. gen_range ( 24 ..image. height ( ) - 24 ) ,
355+ rng. random_range ( 24 ..image. width ( ) - 24 ) ,
356+ rng. random_range ( 24 ..image. height ( ) - 24 ) ,
357357 )
358358 } )
359359 . collect :: < Vec < Point < u32 > > > ( ) ;
0 commit comments