pub struct Tesseract(/* private fields */);
Implementations§
Source§impl Tesseract
impl Tesseract
pub fn new( datapath: Option<&str>, language: Option<&str>, ) -> Result<Self, InitializeError>
pub fn new_with_oem( datapath: Option<&str>, language: Option<&str>, oem: OcrEngineMode, ) -> Result<Self, InitializeError>
pub fn set_image(self, filename: &str) -> Result<Self, SetImageError>
pub fn set_frame( self, frame_data: &[u8], width: i32, height: i32, bytes_per_pixel: i32, bytes_per_line: i32, ) -> Result<Self, TessBaseApiSetImageSafetyError>
pub fn set_image_from_mem(self, img: &[u8]) -> Result<Self, PixReadMemError>
pub fn set_rectangle(self, left: i32, top: i32, width: i32, height: i32) -> Self
pub fn set_source_resolution(self, ppi: i32) -> Self
pub fn set_variable( self, name: &str, value: &str, ) -> Result<Self, SetVariableError>
pub fn recognize(self) -> Result<Self, TessBaseApiRecogniseError>
pub fn get_text(&mut self) -> Result<String, TessBaseApiGetUtf8TextError>
pub fn mean_text_conf(&mut self) -> i32
Sourcepub fn get_hocr_text(
&mut self,
page: c_int,
) -> Result<String, TessBaseApiGetHocrTextError>
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.
Sourcepub fn get_tsv_text(
&mut self,
page: c_int,
) -> Result<String, TessBaseApiGetTsvTextError>
pub fn get_tsv_text( &mut self, page: c_int, ) -> Result<String, TessBaseApiGetTsvTextError>
Get the text encoded as TSV, including bounding boxes, confidence
pub fn set_page_seg_mode(&mut self, mode: PageSegMode)
Auto Trait Implementations§
impl Freeze for Tesseract
impl RefUnwindSafe for Tesseract
impl Send for Tesseract
impl !Sync for Tesseract
impl Unpin for Tesseract
impl UnwindSafe for Tesseract
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