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: “”
Trait Implementations§
source§impl Boxed for TextRecognitionModel
impl Boxed 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
Converts to this type from the input type.
source§impl ModelTrait for TextRecognitionModel
impl ModelTrait for TextRecognitionModel
fn as_raw_mut_Model(&mut self) -> *mut c_void
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>
Set input size for frame. Read more
source§fn set_input_mean(&mut self, mean: Scalar) -> Result<Model>
fn set_input_mean(&mut self, mean: Scalar) -> Result<Model>
Set mean value for frame. Read more
source§fn set_input_scale(&mut self, scale: f64) -> Result<Model>
fn set_input_scale(&mut self, scale: f64) -> Result<Model>
Set scalefactor value for frame. Read more
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>
Set flag swapRB for frame. Read more
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<()>
Set preprocessing parameters for frame. Read more
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: &dyn ToInputArray,
outs: &mut dyn ToOutputArray
) -> Result<()>
fn predict(
&self,
frame: &dyn ToInputArray,
outs: &mut dyn ToOutputArray
) -> Result<()>
Given the @p input frame, create input blob, run net and return the output @p blobs. Read more
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>
Set the decoding method of translating the network output into string Read more
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>
Set the decoding method options for
"CTC-prefix-beam-search"
decode usage Read moresource§fn set_vocabulary(
&mut self,
vocabulary: &Vector<String>
) -> Result<TextRecognitionModel>
fn set_vocabulary(
&mut self,
vocabulary: &Vector<String>
) -> Result<TextRecognitionModel>
Set the vocabulary for recognition. Read more
source§impl TextRecognitionModelTraitConst for TextRecognitionModel
impl TextRecognitionModelTraitConst for TextRecognitionModel
fn as_raw_TextRecognitionModel(&self) -> *const c_void
source§fn get_vocabulary(&self) -> Result<Vector<String>>
fn get_vocabulary(&self) -> Result<Vector<String>>
Get the vocabulary for recognition. Read more
source§fn recognize(&self, frame: &dyn ToInputArray) -> Result<String>
fn recognize(&self, frame: &dyn ToInputArray) -> Result<String>
Given the @p input frame, create input blob, run net and return recognition result Read more
source§fn recognize_1(
&self,
frame: &dyn ToInputArray,
roi_rects: &dyn ToInputArray,
results: &mut Vector<String>
) -> Result<()>
fn recognize_1(
&self,
frame: &dyn ToInputArray,
roi_rects: &dyn ToInputArray,
results: &mut Vector<String>
) -> Result<()>
Given the @p input frame, create input blob, run net and return recognition result Read more