pub struct OcrLine {
pub text: String,
pub bounding_box: BoundingBox,
pub words: Option<Vec<OcrWord>>,
/* private fields */
}
Expand description
The OcrLine
struct represents a line of text recognized by the OCR engine.
It contains the recognized text, its bounding box, and optionally the words within the line.
Fields§
§text: String
§bounding_box: BoundingBox
§words: Option<Vec<OcrWord>>
Implementations§
Source§impl OcrLine
impl OcrLine
Sourcepub fn get_line_style(&self) -> Result<(bool, f32), OneOcrError>
pub fn get_line_style(&self) -> Result<(bool, f32), OneOcrError>
Get the line style and confidence score.
- Returns a tuple containing:
- A boolean indicating if the line is handwritten (true) or printed (false).
- A confidence score (0.0-1.0) indicating the certainty of the classification.
- 0.0: Handwritten
- 1.0: Printed
- Returns an error if the OCR API call fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OcrLine
impl RefUnwindSafe for OcrLine
impl !Send for OcrLine
impl !Sync for OcrLine
impl Unpin for OcrLine
impl UnwindSafe for OcrLine
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
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>
Converts
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>
Converts
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