Thai Alphabet OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Andere Versionen dieses Dokuments:

IronOCR ist eine C#-Softwarekomponente, die es .NET-Programmierern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich des thailändischen Alphabets, zu lesen.

Es ist eine erweiterte Abspaltung von Tesseract, die exklusiv for .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Bezug auf Geschwindigkeit als auch Genauigkeit übertrifft.

Inhalt von IronOcr.Languages.Thai

Dieses Paket enthält 96 OCR-Sprachen for .NET:

  • Thai
  • ThaiBest
  • ThaiFast
  • ThaiAlphabet
  • ThaiAlphabetBest
  • ThaiAlphabetFast

Download

Thailändisches Alphabet Sprachpaket [ไทย]

Installation

Das erste, was wir tun müssen, ist unser Thai Alphabet OCR-Paket in Ihr .NET-Projekt zu installieren.

Install-Package IronOcr.Languages.Thai

Beispielcode

Dieses C#-Codebeispiel liest thailändischen Alphabet-Text aus einem Bild oder PDF-Dokument.

// Ensure you have installed the IronOcr.Languages.Thai package via NuGet.
// Import the IronOcr namespace to work with IronOCR classes.
using IronOcr; 

class ThaiOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract for OCR processing
        var ocr = new IronTesseract();

        // Set the language to Thai for Optical Character Recognition
        ocr.Language = OcrLanguage.Thai;

        // Using the 'using' statement ensures that resources are properly disposed.
        using (var input = new OcrInput(@"images\Thai.png"))
        {
            // Perform OCR to read the text from the input image
            var result = ocr.Read(input);

            // Retrieve and store all recognized text from the image
            string allText = result.Text;

            // Optionally, you can output the text to console or log it as needed
            System.Console.WriteLine(allText);
        }
    }
}
// Ensure you have installed the IronOcr.Languages.Thai package via NuGet.
// Import the IronOcr namespace to work with IronOCR classes.
using IronOcr; 

class ThaiOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract for OCR processing
        var ocr = new IronTesseract();

        // Set the language to Thai for Optical Character Recognition
        ocr.Language = OcrLanguage.Thai;

        // Using the 'using' statement ensures that resources are properly disposed.
        using (var input = new OcrInput(@"images\Thai.png"))
        {
            // Perform OCR to read the text from the input image
            var result = ocr.Read(input);

            // Retrieve and store all recognized text from the image
            string allText = result.Text;

            // Optionally, you can output the text to console or log it as needed
            System.Console.WriteLine(allText);
        }
    }
}
$vbLabelText   $csharpLabel

In diesem Beispiel lesen wir thailändischen Text aus einem Bild mit dem Namen Thai.png, das sich im Ordner images befindet. Stelle sicher, dass du den Dateipfad mit deinem tatsächlichen Bildstandort ersetzt. Die OCR-Sprache ist auf Thai eingestellt, wobei OcrLanguage.Thai das Thai-Sprachpaket für die Erkennung angibt.