Added easier way to set colors + tests
This commit is contained in:
@@ -7,8 +7,6 @@ use rten::Model;
|
||||
use ocrs::{OcrEngine, OcrEngineParams};
|
||||
use image::{ColorType, ImageFormat};
|
||||
|
||||
use crate::Point;
|
||||
|
||||
const MATRIX_LEN: usize = 800;
|
||||
const TEXT_MATRIX_RATIO: f64 = 0.5;
|
||||
const LINE_WIDTH: f64 = 10.0;
|
||||
@@ -18,6 +16,13 @@ const TEXT_X_SIZE: f64 = (MATRIX_X_SIZE as f64) * TEXT_MATRIX_RATIO;
|
||||
const TEXT_X_OFFSET: f64 = (MATRIX_X_SIZE - TEXT_X_SIZE) / 2.0;
|
||||
const LINE_WIDTH_X_OFFSET: f64 = LINE_WIDTH / 2.0;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Point {
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
pub new_line: bool,
|
||||
}
|
||||
|
||||
pub fn print_words(points: &Vec<Point>) -> Result<(), Box<dyn Error>> {
|
||||
|
||||
let begin = Instant::now();
|
||||
|
||||
Reference in New Issue
Block a user