OCR del alfabeto tailandés en C# y .NET
Other versions of this document:
IronOCR es un componente de software C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el Alfabeto Tailandés.
Es una rama avanzada de Tesseract, construida exclusivamente para desarrolladores de .NET y supera regularmente a otros motores de Tesseract tanto en velocidad como en precisión.
Contenido de IronOcr.Languages.Thai
Este paquete contiene 96 idiomas OCR para .NET:
- Thai
- ThaiBest
- ThaiFast
- ThaiAlphabet
- ThaiAlphabetBest
- ThaiAlphabetFast
Descargar
Paquete de Idioma del Alfabeto Tailandés [ไทย]
Instalación
Lo primero que debemos hacer es instalar nuestro paquete OCR del Alfabeto Tailandés en tu proyecto .NET.
Install-Package IronOCR.Languages.Thai
Ejemplo de código
Este ejemplo de código C# lee texto del Alfabeto Tailandés desde una imagen o documento 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 ClassEn este ejemplo, leemos texto tailandés de una imagen llamada Thai.png ubicada en la carpeta images. Asegúrate de reemplazar la ruta del archivo con la ubicación real de tu imagen. El idioma OCR se configura en Tailandés usando OcrLanguage.Thai para especificar el paquete de idioma tailandés para el reconocimiento.





