Thai Alphabet OCR in C# and .NET
Autres versions de ce document :
- En caractères thaïlandais
- 125 langues supplémentaires pour la reconnaissance optique de caractères (OCR)
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 for .NET :
- Thaï
- ThaiBest
- ThaiFast
- Alphabet thaïlandais
- Meilleur alphabet thaïlandais
- ThaiAlphabetFast
Télécharger
Pack de langue alphabet thaï [thaï]
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);
}
}
}
Imports IronOcr
Class ThaiOcrExample
Shared Sub Main()
' Create a new instance of IronTesseract for OCR processing
Dim ocr As 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 As 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
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ï en utilisant OcrLanguage.Thai pour spécifier le package de langue thaï pour la reconnaissance.

