You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, first of all thanks for your efforts for these very nicely done rust bindings :)
I'm trying to use this to read specific regions on screen and output the values. Most of these regions will only contain numeric value (0-9 and ,'s).
Code:
// Location on screen relative to windowlet hp = Bounds{x:965,y:87,width:30,height:20,};// Grab the rgb values of each pixel in this region from the screen and store it in a bufferletmut buffer = ImageBuffer::from_fn(hp.width, hp.height, |x, y| {let rgb = get_pixel_col(hp.x + x, hp.y + y);Rgb([(rgb &0xff)asu8,((rgb >> 8)&0xff)asu8,((rgb >> 16)&0xff)asu8])});// Convert the raw RGB buffer above to TIFF formatletmut tiff_buffer = Vec::new();
buffer.write_to(&mutCursor::new(&mut tiff_buffer),
image::ImageOutputFormat::Tiff,).unwrap();
buffer.save("ocrtest.tiff");// Test to verify image is correctletmut lt = LepTess::new(None,"eng").unwrap();
lt.set_image_from_mem(&tiff_buffer).unwrap();
lt.set_variable(Variable::TesseditCharWhitelist,"0123456789").unwrap();// White list only numeric values
lt.set_source_resolution(240);
Image trying to OCR:
The size is 30px width x 20px height at 240dpi. I'm using the generic English model provided in your repo, would it benefit training a new dataset specifically for this font?
The text was updated successfully, but these errors were encountered:
Hello, first of all thanks for your efforts for these very nicely done rust bindings :)
I'm trying to use this to read specific regions on screen and output the values. Most of these regions will only contain numeric value (0-9 and ,'s).
Code:
Image trying to OCR:
The size is 30px width x 20px height at 240dpi. I'm using the generic English model provided in your repo, would it benefit training a new dataset specifically for this font?
The text was updated successfully, but these errors were encountered: