OCR bosnio en C# y .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR es un componente de software C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el bosnio.

Es una bifurcación avanzada de Tesseract, construida exclusivamente para desarrolladores .NET, y regularmente supera a otros motores Tesseract tanto en velocidad como en precisión.

Contenido de IronOcr.Languages.Bosnian

Este paquete contiene 46 idiomas OCR para .NET:

  • Bosnio
  • BosnianBest
  • BosnianFast

Descargar

Paquete de Idioma Bosnio [bosanski jezik]

Instalación

Lo primero que tenemos que hacer es instalar nuestro paquete OCR Bosnian en tu proyecto .NET.

Install-Package IronOCR.Languages.Bosnian

Ejemplo de código

Este ejemplo de código C# lee texto bosnio de una imagen o documento PDF.

// Ensure the IronOCR library is included
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize an instance of IronTesseract
        var Ocr = new IronTesseract();

        // Set the OCR language to Bosnian
        Ocr.Language = OcrLanguage.Bosnian;

        // Use OcrInput to specify the input file path for OCR
        using (var Input = new OcrInput(@"images\Bosnian.png"))
        {
            // Perform OCR on the input image or PDF
            var Result = Ocr.Read(Input);

            // Extract the recognized text from the result
            var AllText = Result.Text;

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Ensure the IronOCR library is included
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize an instance of IronTesseract
        var Ocr = new IronTesseract();

        // Set the OCR language to Bosnian
        Ocr.Language = OcrLanguage.Bosnian;

        // Use OcrInput to specify the input file path for OCR
        using (var Input = new OcrInput(@"images\Bosnian.png"))
        {
            // Perform OCR on the input image or PDF
            var Result = Ocr.Read(Input);

            // Extract the recognized text from the result
            var AllText = Result.Text;

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Ensure the IronOCR library is included
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Initialize an instance of IronTesseract
		Dim Ocr = New IronTesseract()

		' Set the OCR language to Bosnian
		Ocr.Language = OcrLanguage.Bosnian

		' Use OcrInput to specify the input file path for OCR
		Using Input = New OcrInput("images\Bosnian.png")
			' Perform OCR on the input image or PDF
			Dim Result = Ocr.Read(Input)

			' Extract the recognized text from the result
			Dim AllText = Result.Text

			' Output the recognized text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • El código anterior demuestra cómo realizar OCR en una imagen de texto bosnio usando IronOCR.
  • La clase IronTesseract se utiliza para configurar y ejecutar tareas de OCR.
  • La clase OcrInput se utiliza para especificar el archivo de imagen de entrada del cual se extraerá el texto.
  • Finalmente, el texto reconocido se imprime en la consola.