pub trait TextRecognitionModelTraitConst: ModelTraitConst {
fn as_raw_TextRecognitionModel(&self) -> *const c_void;
fn get_decode_type(&self) -> Result<String> { ... }
fn get_vocabulary(&self) -> Result<Vector<String>> { ... }
fn recognize(&self, frame: &dyn ToInputArray) -> Result<String> { ... }
fn recognize_1(
&self,
frame: &dyn ToInputArray,
roi_rects: &dyn ToInputArray,
results: &mut Vector<String>
) -> Result<()> { ... }
}
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.
Required Methods
fn as_raw_TextRecognitionModel(&self) -> *const c_void
Provided Methods
sourcefn get_decode_type(&self) -> Result<String>
fn get_decode_type(&self) -> Result<String>
sourcefn get_vocabulary(&self) -> Result<Vector<String>>
fn get_vocabulary(&self) -> Result<Vector<String>>
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
Parameters
- frame: The input image
Returns
The text recognition result
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
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.