OCR islandais 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éveloppeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, dont l'islandais. Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET, et elle surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu de IronOcr.Languages.Icelandais

Ce package contient 52 langues OCR pour .NET :

  • Islandais
  • IcelandicBest
  • IcelandicFast

Télécharger

Pack de langue islandaise [\u00cdslenska]<\/span>

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

Installation

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

Install-Package IronOCR.Languages.Icelandic

Exemple de code

Cet exemple de code C# lit du texte islandais à partir d'une image ou d'un document PDF.

using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

        // Load the image or PDF file to be processed
        using (var Input = new OcrInput(@"images\Icelandic.png"))
        {
            // Perform OCR on the input file
            var Result = Ocr.Read(Input);

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

            // Print the extracted text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

        // Load the image or PDF file to be processed
        using (var Input = new OcrInput(@"images\Icelandic.png"))
        {
            // Perform OCR on the input file
            var Result = Ocr.Read(Input);

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

            // Print the extracted text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create an instance of the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

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

		' Load the image or PDF file to be processed
		Using Input = New OcrInput("images\Icelandic.png")
			' Perform OCR on the input file
			Dim Result = Ocr.Read(Input)

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

			' Print the extracted text to the console
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Explication

  • La classe IronTesseract fait partie de la bibliothèque IronOcr, conçue pour effectuer des opérations OCR.
  • Ocr.Language = OcrLanguage.Icelandic; définit la langue OCR sur l'islandais.
  • OcrInput prend le chemin d'accès au fichier d'entrée (une image ou un PDF) et le prépare pour le traitement.
  • Ocr.Read(Input) traite le fichier d'entrée et renvoie le résultat OCR.
  • Result.Text récupère tout le texte reconnu à partir de l'entrée traitée.

Pour exécuter cet exemple correctement, assurez-vous d'avoir installé la bibliothèque IronOCR et son module de langue islandaise dans votre projet .NET.