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
sourceimpl 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
sourceimpl Boxed for TextRecognitionModel
impl Boxed for TextRecognitionModel
sourceimpl Drop for TextRecognitionModel
impl Drop for TextRecognitionModel
sourceimpl From<TextRecognitionModel> for Model
impl From<TextRecognitionModel> for Model
sourcefn from(s: TextRecognitionModel) -> Self
fn from(s: TextRecognitionModel) -> Self
Converts to this type from the input type.
sourceimpl ModelTrait for TextRecognitionModel
impl ModelTrait for TextRecognitionModel
fn as_raw_mut_Model(&mut self) -> *mut c_void
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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>
sourceimpl ModelTraitConst for TextRecognitionModel
impl ModelTraitConst for TextRecognitionModel
fn as_raw_Model(&self) -> *const c_void
sourcefn 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>
sourceimpl TextRecognitionModelTrait for TextRecognitionModel
impl TextRecognitionModelTrait for TextRecognitionModel
fn as_raw_mut_TextRecognitionModel(&mut self) -> *mut c_void
sourcefn 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
sourcefn 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 moresourcefn 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
sourceimpl TextRecognitionModelTraitConst for TextRecognitionModel
impl TextRecognitionModelTraitConst for TextRecognitionModel
fn as_raw_TextRecognitionModel(&self) -> *const c_void
sourcefn get_decode_type(&self) -> Result<String>
fn get_decode_type(&self) -> Result<String>
Get the decoding method Read more
sourcefn get_vocabulary(&self) -> Result<Vector<String>>
fn get_vocabulary(&self) -> Result<Vector<String>>
Get the vocabulary for recognition. Read more
sourcefn 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
sourcefn 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
impl Send for TextRecognitionModel
Auto Trait Implementations
impl RefUnwindSafe for TextRecognitionModel
impl !Sync for TextRecognitionModel
impl Unpin for TextRecognitionModel
impl UnwindSafe for TextRecognitionModel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more