feat(katana): proper name & series reading
This commit is contained in:
@ -2,6 +2,7 @@ pub use log;
|
||||
pub use tracing::{debug, error, info, trace, warn};
|
||||
use tracing_subscriber::{self, fmt, EnvFilter};
|
||||
pub mod constants;
|
||||
pub mod structs;
|
||||
pub mod tesseract;
|
||||
|
||||
pub fn setup_logger(level: &str) -> Result<(), fern::InitError> {
|
||||
|
||||
7
swordfish-common/src/structs.rs
Normal file
7
swordfish-common/src/structs.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#[derive(Debug)]
|
||||
pub struct Card {
|
||||
pub wishlist: Option<i32>,
|
||||
pub name: String,
|
||||
pub series: String,
|
||||
pub print: i32,
|
||||
}
|
||||
@ -5,6 +5,9 @@ pub fn init_tesseract(numeric_only: bool) -> Result<LepTess, String> {
|
||||
Ok(lep_tess) => lep_tess,
|
||||
Err(why) => return Err(format!("Failed to initialize Tesseract: {:?}", why)),
|
||||
};
|
||||
lep_tess.set_variable(Variable::TesseditPagesegMode, "6").unwrap();
|
||||
// Use LSTM only.
|
||||
lep_tess.set_variable(Variable::TesseditOcrEngineMode, "1").unwrap();
|
||||
if numeric_only {
|
||||
match lep_tess.set_variable(Variable::TesseditCharWhitelist, "0123456789") {
|
||||
Ok(_) => (),
|
||||
|
||||
Reference in New Issue
Block a user