pub struct OcrEngine { /* private fields */ }
Expand description
The OcrEngine
struct represents the OneOcr processing engine.
Implementations§
Source§impl OcrEngine
impl OcrEngine
Sourcepub fn new() -> Result<Self, OneOcrError>
pub fn new() -> Result<Self, OneOcrError>
Creates a new instance of the OCR engine. This function loads the necessary library and initializes the OCR pipeline.
Sourcepub fn get_max_recognition_line_count(&self) -> Result<i64, OneOcrError>
pub fn get_max_recognition_line_count(&self) -> Result<i64, OneOcrError>
Retrieves the maximum number of lines that can be recognized. Default is 100.
Sourcepub fn set_max_recognition_line_count(
&self,
count: i64,
) -> Result<(), OneOcrError>
pub fn set_max_recognition_line_count( &self, count: i64, ) -> Result<(), OneOcrError>
Sets the maximum number of lines that can be recognized. Default is 100, range is 0-1000.
Sourcepub fn get_resize_resolution(&self) -> Result<(i64, i64), OneOcrError>
pub fn get_resize_resolution(&self) -> Result<(i64, i64), OneOcrError>
Retrieves the maximum internal resize resolution.
The resize resolution
defines the maximum dimensions to which an image will be automatically scaled internally before OCR processing.
It’s a performance and accuracy trade-off rather than a restriction on the original image’s resolution.
Default is 1152*768.
Sourcepub fn set_resize_resolution(
&self,
width: i64,
height: i64,
) -> Result<(), OneOcrError>
pub fn set_resize_resolution( &self, width: i64, height: i64, ) -> Result<(), OneOcrError>
Sets the maximum internal resize resolution.
The resize resolution
defines the maximum dimensions to which an image will be automatically scaled internally before OCR processing.
It’s a performance and accuracy trade-off rather than a restriction on the original image’s resolution.
The maximum resolution is 1152*768.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OcrEngine
impl RefUnwindSafe for OcrEngine
impl Send for OcrEngine
impl Sync for OcrEngine
impl Unpin for OcrEngine
impl UnwindSafe for OcrEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more