Tesseract
Overview
This free extension is based on Tesseract.JS, a JavaScript library for real-time character detection. This library supports more than 100 languages, automatic text orientation and script detection, a simple interface for reading paragraph, word, and character bounding boxes.
The Wisej.Ext.Tesseract component has a Camera property which allows you to specify a Wisej.Web.Ext.Camera control to attach to perform real-time text detection.
Code samples
Scan text from an image
ScanImageAsync() accepts an image as a parameter and returns an object containing the text, confidence, and list of words from the image.
// Scan an image from a picturebox
ScanResult result = await tesseract1.ScanImageAsync(pictureBox1.Image);
AlertBox.Show(result.Text);
AlertBox.Show(result.Confidence);
AlertBox.Show(result.Words[0]);
Scan text from a camera feed
If you set the Camera property of the Wisej.Ext.Tesseract component to a Wisej.Web.Ext.Camera object, you can use the TextRecognized event, which is fired whenever text is detected in the image from the camera feed.
// Scan an image from the camera feed
private void tesseract1_TextRecognized(object sender, Wisej.Ext.Tesseract.TextRecognizedEventArgs e)
{
AlertBox.Show(e.Text);
}
How to Use
The Tesseract extension can be added to a Wisej.NET project using NuGetPackage Manager.
Last updated
Was this helpful?