Hungarian OCR in C# and .NET
Outras versões deste documento:
IronOCR é um componente de software C# que permite aos programadores .NET ler textos de imagens e documentos PDF em 126 idiomas, incluindo húngaro.
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 do IronOcr.Languages.Hungarian
Este pacote contém 52 linguagens de OCR for .NET:
- Húngaro
- HungarianBest
- HungarianFast
Baixar
Pacote de idioma húngaro [magyar]
Instalação
A primeira coisa que temos que fazer é instalar nosso pacote OCR Húngaro no seu projeto .NET.
Install-Package IronOcr.Languages.Hungarian
Exemplo de código
Este exemplo de código C# lê texto em húngaro de uma imagem ou documento PDF.
// First, ensure you have installed the Hungarian OCR language pack
// via NuGet: Install-Package IronOcr.Languages.Hungarian
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Hungarian.
Ocr.Language = OcrLanguage.Hungarian;
// Load the image file containing Hungarian text
using (var Input = new OcrInput(@"images\Hungarian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Retrieve and store the recognized text
var AllText = Result.Text;
// Output the recognized text to the console (for debugging purposes)
Console.WriteLine(AllText);
}
// First, ensure you have installed the Hungarian OCR language pack
// via NuGet: Install-Package IronOcr.Languages.Hungarian
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Hungarian.
Ocr.Language = OcrLanguage.Hungarian;
// Load the image file containing Hungarian text
using (var Input = new OcrInput(@"images\Hungarian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Retrieve and store the recognized text
var AllText = Result.Text;
// Output the recognized text to the console (for debugging purposes)
Console.WriteLine(AllText);
}
' First, ensure you have installed the Hungarian OCR language pack
' via NuGet: Install-Package IronOcr.Languages.Hungarian
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the OCR language to Hungarian.
Ocr.Language = OcrLanguage.Hungarian
' Load the image file containing Hungarian text
Using Input = New OcrInput("images\Hungarian.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Retrieve and store the recognized text
Dim AllText = Result.Text
' Output the recognized text to the console (for debugging purposes)
Console.WriteLine(AllText)
End Using
Este trecho de código demonstra como configurar um leitor de OCR usando a biblioteca IronOCR para reconhecer texto em húngaro a partir de um arquivo de imagem especificado. O texto extraído é armazenado na variável AllText e pode ser usado conforme necessário dentro de sua aplicação. O exemplo também inclui uma saída de console opcional para verificar os resultados do OCR durante o teste.

