OCR polonais 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# qui permet aux développeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, dont le polonais. 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.Polish

Ce package contient 43 langues OCR pour .NET :

  • Polonais
  • PolishBest
  • PolishFast

Télécharger

Pack de langue polonaise :

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

Installation

La première chose à faire est d'installer le package OCR polonais dans votre projet .NET.

Pour installer le package à l'aide du gestionnaire de packages NuGet, exécutez la commande suivante :

Install-Package IronOCR.Languages.Polish

Exemple de code

Cet exemple de code C# montre comment lire du texte polonais à partir d'une image ou d'un document PDF à l'aide d'IronOCR.

// Install the IronOcr.Languages.Polish package via NuGet before using this code.
using IronOcr;

public class PolishOcrExample
{
    public void ReadPolishTextFromImage()
    {
        // Initialize the IronTesseract object
        var Ocr = new IronTesseract();

        // Set the language to Polish
        Ocr.Language = OcrLanguage.Polish;

        // Provide the path to the image or PDF file containing Polish text
        using (var Input = new OcrInput(@"images\Polish.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Display or process the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Install the IronOcr.Languages.Polish package via NuGet before using this code.
using IronOcr;

public class PolishOcrExample
{
    public void ReadPolishTextFromImage()
    {
        // Initialize the IronTesseract object
        var Ocr = new IronTesseract();

        // Set the language to Polish
        Ocr.Language = OcrLanguage.Polish;

        // Provide the path to the image or PDF file containing Polish text
        using (var Input = new OcrInput(@"images\Polish.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Display or process the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Install the IronOcr.Languages.Polish package via NuGet before using this code.
Imports IronOcr

Public Class PolishOcrExample
	Public Sub ReadPolishTextFromImage()
		' Initialize the IronTesseract object
		Dim Ocr = New IronTesseract()

		' Set the language to Polish
		Ocr.Language = OcrLanguage.Polish

		' Provide the path to the image or PDF file containing Polish text
		Using Input = New OcrInput("images\Polish.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

			' Display or process the recognized text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Ce script initialise le moteur OCR, spécifie la langue (polonais) et traite l'image située à l'emplacement " images\Polish.png " pour extraire et afficher le texte. Vérifiez que le chemin d'accès au fichier est correct et que le logiciel OCR est installé avant d'exécuter le code.