Class TextRecognitionModel
This class represents high-level API for text recognition networks
public class TextRecognitionModel : Model, IDisposable
- Inheritance
-
TextRecognitionModel
- Implements
- Inherited Members
Constructors
TextRecognitionModel(Net)
Create Text Recognition model from deep learning network
public TextRecognitionModel(Net net)
Parameters
net
NetDnn network
Remarks
Set DecodeType and Vocabulary after constructor to initialize the decoding method.
TextRecognitionModel(string, string)
Create Text Recognition model from deep learning network
public TextRecognitionModel(string model, string config = null)
Parameters
model
stringBinary file contains trained weights
config
stringText file contains network configuration
Remarks
Set DecodeType and Vocabulary after constructor to initialize the decoding method.
Properties
DecodeType
Decode type
public string DecodeType { get; set; }
Property Value
Vocabulary
Get or Set the vocabulary for recognition.
public string[] Vocabulary { get; set; }
Property Value
- string[]
Methods
DisposeObject()
Release the memory associated with this text recognition model.
protected override void DisposeObject()
Recognize(IInputArray)
Given the input frame, create input blob, run net and return recognition result.
public string Recognize(IInputArray frame)
Parameters
frame
IInputArrayThe input image
Returns
- string
The text recognition result
Recognize(IInputArray, IInputArrayOfArrays)
Given the input frame, create input blob, run net and return recognition result.
public string[] Recognize(IInputArray frame, IInputArrayOfArrays roiRects)
Parameters
frame
IInputArrayThe input image
roiRects
IInputArrayOfArraysVector of text detection regions of interest (Rect, CV_32SC4). ROIs is be cropped as the network inputs
Returns
- string[]
A set of text recognition results.
SetDecodeOptsCTCPrefixBeamSearch(int, int)
Set the decoding method options for "CTC-prefix-beam-search" decode usage
public void SetDecodeOptsCTCPrefixBeamSearch(int beamSize, int vocPruneSize)