OCR en croate dans 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 le croate. 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.Croatian

Ce package contient la prise en charge de 49 langues OCR pour .NET, notamment :

  • Croate
  • CroatianBest
  • CroatianFast

Télécharger

Pack de langue croate [langue croate]

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

Installation

La première étape consiste à installer le package OCR croate dans votre projet .NET à l'aide de NuGet.

Install-Package IronOCR.Languages.Croatian

Exemple de code

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

// Add the required namespace for IronOCR
using IronOcr;

class OCRExample
{
    public static void Main()
    {
        // Create a new IronTesseract instance
        var Ocr = new IronTesseract();

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

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

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

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
// Add the required namespace for IronOCR
using IronOcr;

class OCRExample
{
    public static void Main()
    {
        // Create a new IronTesseract instance
        var Ocr = new IronTesseract();

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

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

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

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
' Add the required namespace for IronOCR
Imports IronOcr

Friend Class OCRExample
	Public Shared Sub Main()
		' Create a new IronTesseract instance
		Dim Ocr = New IronTesseract()

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

		' Define the input image or PDF containing Croatian text
		Using Input = New OcrInput("images\Croatian.png")
			' Perform OCR on the input
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

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

Explication

  • IronTesseract : Il s'agit de la classe principale utilisée pour effectuer les opérations OCR. Il lit le texte des images ou des fichiers PDF et prend en charge plusieurs langues.
  • OcrInput : Représente la source d'entrée pour la reconnaissance optique de caractères (OCR), qui peut être un fichier image ou PDF.
  • Ocr.Read : Exécute le processus OCR sur l'entrée spécifiée.
  • Result.Text : Contient le texte extrait de l'entrée, qui est ensuite affiché dans la console.