Skip to content

Commit 20961bf

Browse files
authored
Update optflowpyrlk.rs
error vec must be of typed <f32>
1 parent 8f2cb4f commit 20961bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/optflowpyrlk.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ pub fn check_optical_flow_points() -> Result<()>{
4646

4747
fn track_pyr_lk(prev_img: &Mat, cur_img: &Mat, ref_pts: &Vector<Point2f>) -> Vector::<Point2f>{
4848

49-
let mut cur_key_points = Vector::<Point2f>::new();
49+
let mut cur_key_points = Vector::<Point2f>::new();
5050
let min_eig = 1e-4;
5151
let flags = 0; // OPTFLOW_LK_GET_MIN_EIGENVALS vs OPTFLOW_USE_INITIAL_FLOW
5252
let size = Size::new(21,21);
5353
let crit = TermCriteria::default().unwrap(); // TermCriteria::new(typ, 30 , 0.01).unwrap();
5454
let max_levels=3;
55-
let mut err = Vector::<f64>::new();
55+
let mut err = Vector::<f32>::new();
5656
let mut status = Vector::<u8>::new();
5757

5858
let _ =cv::video::calc_optical_flow_pyr_lk(
@@ -82,4 +82,4 @@ pub fn debug_keypoints(kps: &Vector<Point2f>){
8282
points[0..3].iter().for_each(|v| println!("{}, {}", v.x, v.y));
8383
println!("....,");
8484
points[points.len()-3..].iter().for_each(|v| println!("{}, {}", v.x, v.y));
85-
}
85+
}

0 commit comments

Comments
 (0)