pub struct OcrEngineConfig {
pub backend: Backend,
pub thread_count: i32,
pub precision_mode: PrecisionMode,
pub det_options: DetOptions,
pub rec_options: RecOptions,
pub enable_parallel: bool,
pub min_result_confidence: f32,
}Expand description
OCR engine configuration
Fields§
§backend: BackendInference backend
thread_count: i32Thread count
precision_mode: PrecisionModePrecision mode
det_options: DetOptionsDetection options
rec_options: RecOptionsRecognition options
enable_parallel: boolWhether to enable parallel recognition (use rayon to process multiple text regions in parallel)
min_result_confidence: f32Minimum confidence threshold at result level (recognition results below this value will be filtered)
Implementations§
Source§impl OcrEngineConfig
impl OcrEngineConfig
Sourcepub fn with_backend(self, backend: Backend) -> Self
pub fn with_backend(self, backend: Backend) -> Self
Set inference backend
Sourcepub fn with_threads(self, threads: i32) -> Self
pub fn with_threads(self, threads: i32) -> Self
Set thread count
Sourcepub fn with_precision(self, precision: PrecisionMode) -> Self
pub fn with_precision(self, precision: PrecisionMode) -> Self
Set precision mode
Sourcepub fn with_det_options(self, options: DetOptions) -> Self
pub fn with_det_options(self, options: DetOptions) -> Self
Set detection options
Sourcepub fn with_rec_options(self, options: RecOptions) -> Self
pub fn with_rec_options(self, options: RecOptions) -> Self
Set recognition options
Sourcepub fn with_parallel(self, enable: bool) -> Self
pub fn with_parallel(self, enable: bool) -> Self
Enable/disable parallel processing
Note: When multiple text regions are detected, use rayon for parallel recognition. If MNN is already set to multi-threading, enabling this option may cause thread contention.
Sourcepub fn with_min_result_confidence(self, threshold: f32) -> Self
pub fn with_min_result_confidence(self, threshold: f32) -> Self
Set minimum confidence threshold at result level
Recognition results below this threshold will be filtered out. Recommended values: 0.5 (lenient), 0.7 (balanced), 0.9 (strict)
Trait Implementations§
Source§impl Clone for OcrEngineConfig
impl Clone for OcrEngineConfig
Source§fn clone(&self) -> OcrEngineConfig
fn clone(&self) -> OcrEngineConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OcrEngineConfig
impl Debug for OcrEngineConfig
Auto Trait Implementations§
impl Freeze for OcrEngineConfig
impl RefUnwindSafe for OcrEngineConfig
impl Send for OcrEngineConfig
impl Sync for OcrEngineConfig
impl Unpin for OcrEngineConfig
impl UnwindSafe for OcrEngineConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.