OCR bosnien en C# et .NET

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

IronOCR est un composant logiciel C# permettant aux d\u00e9veloppeurs .NET de lire du texte \u00e0 partir d'images et de documents PDF en 126 langues, y compris le bosniaque.

Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET, et qui surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu de IronOcr.Languages.Bosnien

Ce package contient 46 langues OCR pour .NET :

  • Bosniaque
  • BosnianBest
  • BosnianFast

Télécharger

Pack de langue bosniaque [Langue bosniaque]

  • Télécharger au format Zip
  • Installer avec NuGet

Installation

La première chose à faire est d'installer notre package OCR bosnien sur votre projet .NET.

Install-Package IronOCR.Languages.Bosnian

Exemple de code

Cet exemple de code C# lit du texte bosniaque \u00e0 partir d'une image ou d'un document 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
  • Le code ci-dessus montre comment effectuer une reconnaissance optique de caractères (OCR) sur une image de texte bosnien à l'aide d'IronOCR.
  • La classe IronTesseract est utilisée pour configurer et exécuter les tâches OCR.
  • La classe OcrInput est utilisée pour spécifier le fichier image d'entrée à partir duquel le texte doit être extrait. Enfin, le texte reconnu est imprimé sur la console.