Struct opencv::dnn::TextRecognitionModel
source · pub struct TextRecognitionModel { /* private fields */ }
Expand description
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.
Implementations§
source§impl TextRecognitionModel
impl TextRecognitionModel
pub fn default() -> Result<TextRecognitionModel>
sourcepub fn new(network: &Net) -> Result<TextRecognitionModel>
pub fn new(network: &Net) -> Result<TextRecognitionModel>
Create Text Recognition model from deep learning network Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Parameters
- network: Net object
sourcepub fn from_file(model: &str, config: &str) -> Result<TextRecognitionModel>
pub fn from_file(model: &str, config: &str) -> Result<TextRecognitionModel>
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Parameters
- model: Binary file contains trained weights
- config: Text file contains network configuration
C++ default parameters
- config: “”
sourcepub fn from_file_def(model: &str) -> Result<TextRecognitionModel>
pub fn from_file_def(model: &str) -> Result<TextRecognitionModel>
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Parameters
- model: Binary file contains trained weights
- config: Text file contains network configuration
Note
This alternative version of [from_file] function uses the following default values for its arguments:
- config: “”
Trait Implementations§
source§impl Boxed for TextRecognitionModel
impl Boxed for TextRecognitionModel
source§impl Clone for TextRecognitionModel
impl Clone for TextRecognitionModel
source§impl Debug for TextRecognitionModel
impl Debug for TextRecognitionModel
source§impl Drop for TextRecognitionModel
impl Drop for TextRecognitionModel
source§impl From<TextRecognitionModel> for Model
impl From<TextRecognitionModel> for Model
source§fn from(s: TextRecognitionModel) -> Self
fn from(s: TextRecognitionModel) -> Self
source§impl ModelTrait for TextRecognitionModel
impl ModelTrait for TextRecognitionModel
fn as_raw_mut_Model(&mut self) -> *mut c_void
fn set(&mut self, unnamed: &Model)
fn set_1(&mut self, unnamed: Model)
source§fn set_input_size_1(&mut self, width: i32, height: i32) -> Result<Model>
fn set_input_size_1(&mut self, width: i32, height: i32) -> Result<Model>
source§fn set_input_mean(&mut self, mean: Scalar) -> Result<Model>
fn set_input_mean(&mut self, mean: Scalar) -> Result<Model>
source§fn set_input_scale(&mut self, scale: Scalar) -> Result<Model>
fn set_input_scale(&mut self, scale: Scalar) -> Result<Model>
source§fn set_input_swap_rb(&mut self, swap_rb: bool) -> Result<Model>
fn set_input_swap_rb(&mut self, swap_rb: bool) -> Result<Model>
source§fn set_input_params(
&mut self,
scale: f64,
size: Size,
mean: Scalar,
swap_rb: bool,
crop: bool
) -> Result<()>
fn set_input_params( &mut self, scale: f64, size: Size, mean: Scalar, swap_rb: bool, crop: bool ) -> Result<()>
source§fn set_input_params_def(&mut self) -> Result<()>
fn set_input_params_def(&mut self) -> Result<()>
fn get_network__1(&mut self) -> Result<Net>
source§impl ModelTraitConst for TextRecognitionModel
impl ModelTraitConst for TextRecognitionModel
fn as_raw_Model(&self) -> *const c_void
source§fn predict(
&self,
frame: &impl ToInputArray,
outs: &mut impl ToOutputArray
) -> Result<()>
fn predict( &self, frame: &impl ToInputArray, outs: &mut impl ToOutputArray ) -> Result<()>
fn get_network_(&self) -> Result<Net>
source§impl TextRecognitionModelTrait for TextRecognitionModel
impl TextRecognitionModelTrait for TextRecognitionModel
fn as_raw_mut_TextRecognitionModel(&mut self) -> *mut c_void
source§fn set_decode_type(&mut self, decode_type: &str) -> Result<TextRecognitionModel>
fn set_decode_type(&mut self, decode_type: &str) -> Result<TextRecognitionModel>
source§fn set_decode_opts_ctc_prefix_beam_search(
&mut self,
beam_size: i32,
voc_prune_size: i32
) -> Result<TextRecognitionModel>
fn set_decode_opts_ctc_prefix_beam_search( &mut self, beam_size: i32, voc_prune_size: i32 ) -> Result<TextRecognitionModel>
"CTC-prefix-beam-search"
decode usage Read moresource§fn set_decode_opts_ctc_prefix_beam_search_def(
&mut self,
beam_size: i32
) -> Result<TextRecognitionModel>
fn set_decode_opts_ctc_prefix_beam_search_def( &mut self, beam_size: i32 ) -> Result<TextRecognitionModel>
"CTC-prefix-beam-search"
decode usage Read more