Skip to main content

TextRecognizedEventArgs

Namespace: Wisej.Ext.Tesseract

Assembly: Wisej.Ext.Tesseract (4.1.0.0)

Event arguments for a text recognition event.

public class TextRecognizedEventArgs : EventArgs

Constructors​

Instance member TextRecognizedEventArgs(confidence, text, words)​

Creates a new instance of TextRecognizedEventArgs with the given configuration.

NameTypeDescription
confidenceInt32The confidence of the recognition. Generally a higher confidence indicates that the result is more accurate.
textStringThe text discovered.
wordsString[]An array of strings containing the words discovered.

Example:

// Instances are created by the Tesseract component when it raises the
// TextRecognized event. Handle the event to read the recognized text:
tesseract1.TextRecognized += (sender, e) =>
{
if (e.Confidence >= 75)
{
label1.Text = e.Text;
listBox1.Items.Clear();
listBox1.Items.AddRange(e.Words);
}
};

// Or create an instance directly, e.g. to simulate the event in a test:
var args = new TextRecognizedEventArgs(90, "Invoice 1234", new[] { "Invoice", "1234" });

Properties​

Instance member Confidence​

Int32: Returns the confidence level of the scan event.

Generally a higher confidence indicates that the result is more accurate.

Instance member Text​

String: Returns the text detected during the scan event.

Instance member Words​

String[]: Returns a list of words that were detected during the scan event.