fix: better img loader.

Now the name could be at the wanted size
This commit is contained in:
Lapin Raving 2023-09-14 20:42:12 +02:00
parent 3ceb80edc4
commit e991fffdb1

View File

@ -45,7 +45,6 @@ const DEBUG: bool = true;
pub enum Sequence { pub enum Sequence {
//TODO: avoir le meme nombre d'image en mode capture ET en mode replay //TODO: avoir le meme nombre d'image en mode capture ET en mode replay
FirstState, FirstState,
WaitSpace,
BackGround, BackGround,
UpBorder, UpBorder,
LeftBorder, LeftBorder,
@ -54,6 +53,7 @@ pub enum Sequence {
ReadDir, ReadDir,
ComputeArea, ComputeArea,
Finish, Finish,
WaitSpace,
WaitQ, WaitQ,
@ -176,7 +176,7 @@ impl Qualibration {
}; };
} }
} }
println!("sequence: {:?}", self.id); //println!("sequence: {:?}", self.id);
self.frame_prev = self.frame.clone(); self.frame_prev = self.frame.clone();
Ok(()) Ok(())
} }
@ -506,9 +506,10 @@ impl Qualibration {
for entry in paths { for entry in paths {
let dir = entry?; let dir = entry?;
let path = dir.path(); let path = dir.path();
let a: Vec<_> = path.to_str().unwrap().to_string().chars().collect(); let c: Vec<&str> = path.to_str().unwrap().split("/").collect();
let b: String = a[27..(a.len() - 4)].iter().collect(); let d: Vec<_> = c[c.len()-1].chars().collect();
let img_id: i32 = b.parse()?; let e: String = d[4..d.len()-4].iter().collect();
let img_id: i32 = e.parse()?;
let path = format!("{path:?}"); let path = format!("{path:?}");
let path = path[1..(path.len() - 1)].to_owned(); let path = path[1..(path.len() - 1)].to_owned();
let img: Mat = imread(&find_file(&path, false, false)?, IMREAD_COLOR)?; let img: Mat = imread(&find_file(&path, false, false)?, IMREAD_COLOR)?;