Thai Alphabet OCR in C# and .NET
Outras versões deste documento:
O IronOCR é um componente de software em C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o alfabeto tailandês.
Trata-se de uma versão avançada do Tesseract, criada exclusivamente para desenvolvedores .NET e que supera regularmente outros mecanismos do Tesseract em termos de velocidade e precisão.
Conteúdo de IronOcr.Idiomas.Tailandês
Este pacote contém 96 linguagens de OCR for .NET:
- Tailandês
- ThaiBest
- ThaiFast
- Alfabeto Tailandês
- Melhor Alfabeto Tailandês
- Alfabeto Tailandês Rápido
Baixar
Pacote de idioma do alfabeto tailandês [ไทย]
Instalação
A primeira coisa que precisamos fazer é instalar nosso pacote de OCR do alfabeto tailandês em seu projeto .NET.
Install-Package IronOcr.Languages.Thai
Exemplo de código
Este exemplo de código C# lê texto em alfabeto tailandês de uma imagem ou 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);
}
}
}
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
Neste exemplo, lemos texto em tailandês de uma imagem chamada Thai.png localizada na pasta images. Certifique-se de substituir o caminho do arquivo pelo local onde sua imagem está armazenada. O idioma OCR é definido como tailandês usando OcrLanguage.Thai para especificar o pacote de idioma tailandês para reconhecimento.

