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
1 changed files with 6 additions and 5 deletions

View File

@ -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)?;