TextRecognizedEventArgs
Namespace: Wisej.Ext.Tesseract
Assembly: Wisej.Ext.Tesseract (4.1.0.0)
Event arguments for a text recognition event.
- C#
- VB.NET
public class TextRecognizedEventArgs : EventArgs
Public Class TextRecognizedEventArgs
Inherits EventArgs
Constructors
TextRecognizedEventArgs(confidence, text, words)
Creates a new instance of TextRecognizedEventArgs with the given configuration.
| Name | Type | Description |
|---|---|---|
| confidence | Int32 | The confidence of the recognition. Generally a higher confidence indicates that the result is more accurate. |
| text | String | The text discovered. |
| words | String[] | 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
Confidence
Int32: Returns the confidence level of the scan event.
Generally a higher confidence indicates that the result is more accurate.
Text
String: Returns the text detected during the scan event.
Words
String[]: Returns a list of words that were detected during the scan event.