Lao OCR in C# and .NET
Outras versões deste documento:
IronOCR é um componente de software C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo Lao.
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údos de IronOcr.Languages.Lao
Este pacote contém múltiplos modelos de OCR for .NET:
- Lao
- LaoBest
- LaoFast
- LaoAlphabet
- LaoAlphabetBest
- LaoAlphabetFast
Baixar
Pacote de Idioma Lao [ພາສາລາວ]
Instalação
A primeira coisa que precisamos fazer é instalar o pacote de OCR Lao no seu projeto .NET.
Install-Package IronOcr.Languages.Lao
Exemplo de código
Este exemplo de código C# lê texto em Lao de uma imagem ou documento PDF.
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;
// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// Output the recognized text for verification
Console.WriteLine(AllText);
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;
// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// Output the recognized text for verification
Console.WriteLine(AllText);
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr
' Create a new IronTesseract instance
Private Ocr = New IronTesseract()
' Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao
' Use a using statement to ensure proper disposal of resources
Using Input = New OcrInput("images\Lao.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Extract all text from the OCR result
Dim AllText = Result.Text
' Output the recognized text for verification
Console.WriteLine(AllText)
End Using
Explicação:
- Este código demonstra como configurar e usar IronOCR para executar OCR especificamente para o idioma Lao.
IronTesseracté a classe principal usada para realizar operações de OCR.- O idioma é definido para Lao usando
Ocr.Language. OcrInputé uma classe usada para carregar imagens ou documentos PDF para processamento de OCR.- O método
Ocr.Readprocessa a entrada e retorna um resultado contendo o texto reconhecido. - A declaração
usinggarante que os recursos sejam liberados após o uso. - Finalmente, o texto reconhecido é impresso no console para verificação de saída.

