From e991fffdb14af8aaf9a9a957c16d2a7a267bfb90 Mon Sep 17 00:00:00 2001 From: Lapin Raving Date: Thu, 14 Sep 2023 20:42:12 +0200 Subject: [PATCH] fix: better img loader. Now the name could be at the wanted size --- src/qualibration.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qualibration.rs b/src/qualibration.rs index 2d6c5df..01e645d 100644 --- a/src/qualibration.rs +++ b/src/qualibration.rs @@ -45,7 +45,6 @@ const DEBUG: bool = true; pub enum Sequence { //TODO: avoir le meme nombre d'image en mode capture ET en mode replay FirstState, - WaitSpace, BackGround, UpBorder, LeftBorder, @@ -54,6 +53,7 @@ pub enum Sequence { ReadDir, ComputeArea, Finish, + WaitSpace, WaitQ, @@ -176,7 +176,7 @@ impl Qualibration { }; } } - println!("sequence: {:?}", self.id); + //println!("sequence: {:?}", self.id); self.frame_prev = self.frame.clone(); Ok(()) } @@ -506,9 +506,10 @@ impl Qualibration { for entry in paths { let dir = entry?; let path = dir.path(); - let a: Vec<_> = path.to_str().unwrap().to_string().chars().collect(); - let b: String = a[27..(a.len() - 4)].iter().collect(); - let img_id: i32 = b.parse()?; + let c: Vec<&str> = path.to_str().unwrap().split("/").collect(); + let d: Vec<_> = c[c.len()-1].chars().collect(); + let e: String = d[4..d.len()-4].iter().collect(); + let img_id: i32 = e.parse()?; let path = format!("{path:?}"); let path = path[1..(path.len() - 1)].to_owned(); let img: Mat = imread(&find_file(&path, false, false)?, IMREAD_COLOR)?;