Struct Tesseract

Source
pub struct Tesseract(/* private fields */);

Implementations§

Source§

impl Tesseract

Source

pub fn new( datapath: Option<&str>, language: Option<&str>, ) -> Result<Self, InitializeError>

Source

pub fn new_with_oem( datapath: Option<&str>, language: Option<&str>, oem: OcrEngineMode, ) -> Result<Self, InitializeError>

Source

pub fn set_image(self, filename: &str) -> Result<Self, SetImageError>

Source

pub fn set_frame( self, frame_data: &[u8], width: i32, height: i32, bytes_per_pixel: i32, bytes_per_line: i32, ) -> Result<Self, TessBaseApiSetImageSafetyError>

Source

pub fn set_image_from_mem(self, img: &[u8]) -> Result<Self, PixReadMemError>

Source

pub fn set_rectangle(self, left: i32, top: i32, width: i32, height: i32) -> Self

Source

pub fn set_source_resolution(self, ppi: i32) -> Self

Source

pub fn set_variable( self, name: &str, value: &str, ) -> Result<Self, SetVariableError>

Source

pub fn recognize(self) -> Result<Self, TessBaseApiRecogniseError>

Source

pub fn get_text(&mut self) -> Result<String, TessBaseApiGetUtf8TextError>

Source

pub fn mean_text_conf(&mut self) -> i32

Source

pub fn get_hocr_text( &mut self, page: c_int, ) -> Result<String, TessBaseApiGetHocrTextError>

Get the text encoded as HTML with bounding box tags

See img.html for an example.

Source

pub fn get_tsv_text( &mut self, page: c_int, ) -> Result<String, TessBaseApiGetTsvTextError>

Get the text encoded as TSV, including bounding boxes, confidence

See char* TessBaseAPI::GetTSVText

Source

pub fn set_page_seg_mode(&mut self, mode: PageSegMode)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.