Table of Contents

Class TextRecognitionModel

Namespace
Emgu.CV.Dnn
Assembly
Emgu.CV.dll

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 Net

Dnn 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 string

Binary file contains trained weights

config string

Text 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

string

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 IInputArray

The 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 IInputArray

The input image

roiRects IInputArrayOfArrays

Vector 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)

Parameters

beamSize int

Beam size for search

vocPruneSize int

Parameter to optimize big vocabulary search, only take top vocPruneSize tokens in each search step, vocPruneSize <= 0 stands for disable this prune.