[][src]Trait opencv::dnn::prelude::TextRecognitionModelTrait

pub trait TextRecognitionModelTrait: ModelTrait {
    pub fn as_raw_TextRecognitionModel(&self) -> *const c_void;
pub fn as_raw_mut_TextRecognitionModel(&mut self) -> *mut c_void; pub fn set_decode_type(
        &mut self,
        decode_type: &str
    ) -> Result<TextRecognitionModel> { ... }
pub fn get_decode_type(&self) -> Result<String> { ... }
pub fn set_vocabulary(
        &mut self,
        vocabulary: &Vector<String>
    ) -> Result<TextRecognitionModel> { ... }
pub fn get_vocabulary(&self) -> Result<Vector<String>> { ... }
pub fn recognize(&self, frame: &dyn ToInputArray) -> Result<String> { ... }
pub fn recognize_1(
        &self,
        frame: &dyn ToInputArray,
        roi_rects: &dyn ToInputArray,
        results: &mut Vector<String>
    ) -> Result<()> { ... } }

This class represents high-level API for text recognition networks.

TextRecognitionModel allows to set params for preprocessing input image. TextRecognitionModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return recognition result. For TextRecognitionModel, CRNN-CTC is supported.

Required methods

Loading content...

Provided methods

pub fn set_decode_type(
    &mut self,
    decode_type: &str
) -> Result<TextRecognitionModel>
[src]

Set the decoding method of translating the network output into string

Parameters

  • decodeType: The decoding method of translating the network output into string: {'CTC-greedy': greedy decoding for the output of CTC-based methods}

pub fn get_decode_type(&self) -> Result<String>[src]

Get the decoding method

Returns

the decoding method

pub fn set_vocabulary(
    &mut self,
    vocabulary: &Vector<String>
) -> Result<TextRecognitionModel>
[src]

Set the vocabulary for recognition.

Parameters

  • vocabulary: the associated vocabulary of the network.

pub fn get_vocabulary(&self) -> Result<Vector<String>>[src]

Get the vocabulary for recognition.

Returns

vocabulary the associated vocabulary

pub fn recognize(&self, frame: &dyn ToInputArray) -> Result<String>[src]

Given the @p input frame, create input blob, run net and return recognition result

Parameters

  • frame: The input image

Returns

The text recognition result

pub fn recognize_1(
    &self,
    frame: &dyn ToInputArray,
    roi_rects: &dyn ToInputArray,
    results: &mut Vector<String>
) -> Result<()>
[src]

Given the @p input frame, create input blob, run net and return recognition result

Parameters

  • frame: The input image
  • roiRects: List of text detection regions of interest (cv::Rect, CV_32SC4). ROIs is be cropped as the network inputs
  • results:[out] A set of text recognition results.
Loading content...

Implementors

Loading content...