Trait OCRHolisticWordRecognizerTrait

Source
pub trait OCRHolisticWordRecognizerTrait: BaseOCRTrait + OCRHolisticWordRecognizerTraitConst {
    // Required method
    fn as_raw_mut_OCRHolisticWordRecognizer(&mut self) -> *mut c_void;

    // Provided methods
    fn run(
        &mut self,
        image: &mut impl MatTrait,
        output_text: &mut String,
        component_rects: &mut Vector<Rect>,
        component_texts: &mut Vector<String>,
        component_confidences: &mut Vector<f32>,
        component_level: i32,
    ) -> Result<()> { ... }
    fn run_def(
        &mut self,
        image: &mut impl MatTrait,
        output_text: &mut String,
    ) -> Result<()> { ... }
    fn run_mask(
        &mut self,
        image: &mut impl MatTrait,
        mask: &mut impl MatTrait,
        output_text: &mut String,
        component_rects: &mut Vector<Rect>,
        component_texts: &mut Vector<String>,
        component_confidences: &mut Vector<f32>,
        component_level: i32,
    ) -> Result<()> { ... }
    fn run_mask_def(
        &mut self,
        image: &mut impl MatTrait,
        mask: &mut impl MatTrait,
        output_text: &mut String,
    ) -> Result<()> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

fn run( &mut self, image: &mut impl MatTrait, output_text: &mut String, component_rects: &mut Vector<Rect>, component_texts: &mut Vector<String>, component_confidences: &mut Vector<f32>, component_level: i32, ) -> Result<()>

§C++ default parameters
  • component_rects: NULL
  • component_texts: NULL
  • component_confidences: NULL
  • component_level: OCR_LEVEL_WORD
Source

fn run_def( &mut self, image: &mut impl MatTrait, output_text: &mut String, ) -> Result<()>

§Note

This alternative version of OCRHolisticWordRecognizerTrait::run function uses the following default values for its arguments:

  • component_rects: NULL
  • component_texts: NULL
  • component_confidences: NULL
  • component_level: OCR_LEVEL_WORD
Source

fn run_mask( &mut self, image: &mut impl MatTrait, mask: &mut impl MatTrait, output_text: &mut String, component_rects: &mut Vector<Rect>, component_texts: &mut Vector<String>, component_confidences: &mut Vector<f32>, component_level: i32, ) -> Result<()>

Recognize text using a segmentation based word-spotting/classifier cnn.

Takes image on input and returns recognized text in the output_text parameter. Optionally provides also the Rects for individual text elements found (e.g. words), and the list of those text elements with their confidence values.

§Parameters
  • image: Input image CV_8UC1 or CV_8UC3

  • mask: is totally ignored and is only available for compatibillity reasons

  • output_text: Output text of the the word spoting, always one that exists in the dictionary.

  • component_rects: Not applicable for word spotting can be be NULL if not, a single elemnt will be put in the vector.

  • component_texts: Not applicable for word spotting can be be NULL if not, a single elemnt will be put in the vector.

  • component_confidences: Not applicable for word spotting can be be NULL if not, a single elemnt will be put in the vector.

  • component_level: must be OCR_LEVEL_WORD.

§C++ default parameters
  • component_rects: NULL
  • component_texts: NULL
  • component_confidences: NULL
  • component_level: OCR_LEVEL_WORD
Source

fn run_mask_def( &mut self, image: &mut impl MatTrait, mask: &mut impl MatTrait, output_text: &mut String, ) -> Result<()>

Recognize text using a segmentation based word-spotting/classifier cnn.

Takes image on input and returns recognized text in the output_text parameter. Optionally provides also the Rects for individual text elements found (e.g. words), and the list of those text elements with their confidence values.

§Parameters
  • image: Input image CV_8UC1 or CV_8UC3

  • mask: is totally ignored and is only available for compatibillity reasons

  • output_text: Output text of the the word spoting, always one that exists in the dictionary.

  • component_rects: Not applicable for word spotting can be be NULL if not, a single elemnt will be put in the vector.

  • component_texts: Not applicable for word spotting can be be NULL if not, a single elemnt will be put in the vector.

  • component_confidences: Not applicable for word spotting can be be NULL if not, a single elemnt will be put in the vector.

  • component_level: must be OCR_LEVEL_WORD.

§Note

This alternative version of OCRHolisticWordRecognizerTrait::run_mask function uses the following default values for its arguments:

  • component_rects: NULL
  • component_texts: NULL
  • component_confidences: NULL
  • component_level: OCR_LEVEL_WORD

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§