Hungarian OCR in C# and .NET
Otras versiones de este documento:
IronOCR es un componente de software en C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el húngaro.
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.Hungarian
Este paquete contiene 52 idiomas de OCR for .NET:
- Húngaro
- HungarianBest
- HungarianFast
Descargar
Paquete de idioma húngaro [magyar]
Instalación
Lo primero que tenemos que hacer es instalar nuestro paquete OCR en húngaro en tu proyecto .NET.
Install-Package IronOcr.Languages.Hungarian
Ejemplo de código
Este ejemplo de código en C# lee texto en húngaro de una imagen o 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 fragmento de código muestra cómo configurar un lector de OCR con la biblioteca IronOCR para reconocer texto en húngaro de un archivo de imagen específico. El texto extraído se almacena en la variable AllText y puede usarse según sea necesario en la aplicación. El ejemplo también incluye una salida opcional en la consola para verificar los resultados del OCR durante las pruebas.

