Danish OCR in C# and .NET
Otras versiones de este documento:
IronOCR es un componente de software en C# que permite a los programadores .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el danés.
Es una bifurcación avanzada de Tesseract, desarrollada exclusivamente para desarrolladores .NET, y supera regularmente a otros motores Tesseract tanto en velocidad como en precisión.
Contenido de IronOcr.Languages.Danish
Este paquete contiene 61 idiomas OCR for .NET:
- Danés
- DanésBest
- DanésFast
- DanésFraktur
Descargar
Paquete de idioma danés [dansk]
Instalación
El primer paso es instalar el paquete OCR danés en tu proyecto .NET.
Install-Package IronOcr.Languages.Danish
Ejemplo de código
Este ejemplo de código en C# lee texto en danés de una imagen o documento PDF utilizando IronOCR.
// Import the IronOcr namespace to access OCR functionalities
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract object, which will handle OCR operations
var Ocr = new IronTesseract();
// Set the language for OCR to Danish
Ocr.Language = OcrLanguage.Danish;
// Using a 'using' statement to ensure the OcrInput object is disposed of correctly
using (var Input = new OcrInput(@"images\Danish.png"))
{
// Perform OCR on the input image and store the result
var Result = Ocr.Read(Input);
// Extract the recognized text from the result
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace to access OCR functionalities
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract object, which will handle OCR operations
var Ocr = new IronTesseract();
// Set the language for OCR to Danish
Ocr.Language = OcrLanguage.Danish;
// Using a 'using' statement to ensure the OcrInput object is disposed of correctly
using (var Input = new OcrInput(@"images\Danish.png"))
{
// Perform OCR on the input image and store the result
var Result = Ocr.Read(Input);
// Extract the recognized text from the result
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace to access OCR functionalities
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Initialize the IronTesseract object, which will handle OCR operations
Dim Ocr = New IronTesseract()
' Set the language for OCR to Danish
Ocr.Language = OcrLanguage.Danish
' Using a 'using' statement to ensure the OcrInput object is disposed of correctly
Using Input = New OcrInput("images\Danish.png")
' Perform OCR on the input image and store the result
Dim Result = Ocr.Read(Input)
' Extract the recognized text from the result
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Este ejemplo muestra cómo configurar IronOCR para leer texto en danés a partir de un archivo de imagen. El objeto IronTesseract está configurado para utilizar el idioma danés, y se carga una imagen con OcrInput. Ocr.Read realiza el OCR, y el texto reconocido se extrae y imprime.

