OCR de l'alphabet thaï en C# et .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR est un composant logiciel C# permettant aux développeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, y compris l'alphabet thaï.

Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET et qui surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu de IronOcr.Languages.Thai

Ce package contient 96 langues OCR pour .NET :

  • Thaï
  • ThaiBest
  • ThaiFast
  • Alphabet thaïlandais
  • Meilleur alphabet thaïlandais
  • ThaiAlphabetFast

Télécharger

Pack de langue alphabet thaï [thaï]

  • Télécharger au format Zip
  • Installer avec NuGet

Installation

La première chose à faire est d'installer notre package OCR d'alphabet thaï sur votre projet .NET.

Install-Package IronOCR.Languages.Thai

Exemple de code

Cet exemple de code C# lit du texte en alphabet thaï à partir d'une image ou d'un document PDF.

// 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);
        }
    }
}
' Ensure you have installed the IronOCR.Languages.Thai package via NuGet.
' Import the IronOcr namespace to work with IronOCR classes.
Imports IronOcr

Friend Class ThaiOcrExample
	Shared Sub Main()
		' Create a new instance of IronTesseract for OCR processing
		Dim 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 input = New OcrInput("images\Thai.png")
			' Perform OCR to read the text from the input image
			Dim result = ocr.Read(input)

			' Retrieve and store all recognized text from the image
			Dim allText As String = result.Text

			' Optionally, you can output the text to console or log it as needed
			System.Console.WriteLine(allText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Dans cet exemple, nous lisons du texte thaï à partir d'une image nommée Thai.png située dans le dossier images . Veillez à remplacer le chemin d'accès au fichier par l'emplacement réel de votre image. La langue OCR est définie sur le thaï à l'aide OcrLanguage.Thai afin de spécifier le module linguistique thaï pour la reconnaissance.