pub struct OcrProcessingResult {
pub text: String,
pub confidence: f64,
pub fragments: Vec<OcrTextFragment>,
pub processing_time_ms: u64,
pub engine_name: String,
pub language: String,
pub processed_region: Option<OcrRegion>,
pub image_dimensions: (u32, u32),
}Expand description
Complete result of OCR processing
Fields§
§text: StringThe complete extracted text
confidence: f64Overall confidence score (0.0 to 1.0)
fragments: Vec<OcrTextFragment>Individual text fragments with position information
processing_time_ms: u64Processing time in milliseconds
engine_name: StringOCR engine used for processing
language: StringLanguage detected/used
processed_region: Option<OcrRegion>Region that was processed (None if entire image was processed)
image_dimensions: (u32, u32)Image dimensions that were processed
Implementations§
Source§impl OcrProcessingResult
impl OcrProcessingResult
Sourcepub fn new(
text: String,
confidence: f64,
fragments: Vec<OcrTextFragment>,
processing_time_ms: u64,
engine_name: String,
language: String,
image_dimensions: (u32, u32),
) -> Self
pub fn new( text: String, confidence: f64, fragments: Vec<OcrTextFragment>, processing_time_ms: u64, engine_name: String, language: String, image_dimensions: (u32, u32), ) -> Self
Create a new OCR processing result
Sourcepub fn with_region(
text: String,
confidence: f64,
fragments: Vec<OcrTextFragment>,
processing_time_ms: u64,
engine_name: String,
language: String,
image_dimensions: (u32, u32),
region: OcrRegion,
) -> Self
pub fn with_region( text: String, confidence: f64, fragments: Vec<OcrTextFragment>, processing_time_ms: u64, engine_name: String, language: String, image_dimensions: (u32, u32), region: OcrRegion, ) -> Self
Create a new OCR processing result for a specific region
Sourcepub fn filter_by_confidence(&self, min_confidence: f64) -> Vec<&OcrTextFragment>
pub fn filter_by_confidence(&self, min_confidence: f64) -> Vec<&OcrTextFragment>
Filter fragments by minimum confidence
Sourcepub fn fragments_in_region(
&self,
x: f64,
y: f64,
width: f64,
height: f64,
) -> Vec<&OcrTextFragment>
pub fn fragments_in_region( &self, x: f64, y: f64, width: f64, height: f64, ) -> Vec<&OcrTextFragment>
Get text fragments within a specific region
Sourcepub fn fragments_of_type(
&self,
fragment_type: FragmentType,
) -> Vec<&OcrTextFragment>
pub fn fragments_of_type( &self, fragment_type: FragmentType, ) -> Vec<&OcrTextFragment>
Get fragments of a specific type
Sourcepub fn average_confidence(&self) -> f64
pub fn average_confidence(&self) -> f64
Calculate average confidence for all fragments
Trait Implementations§
Source§impl Clone for OcrProcessingResult
impl Clone for OcrProcessingResult
Source§fn clone(&self) -> OcrProcessingResult
fn clone(&self) -> OcrProcessingResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OcrProcessingResult
impl RefUnwindSafe for OcrProcessingResult
impl Send for OcrProcessingResult
impl Sync for OcrProcessingResult
impl Unpin for OcrProcessingResult
impl UnwindSafe for OcrProcessingResult
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
Mutably borrows from an owned value. Read more