OCR de l'alphabet Hangul en C# et .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English

126 autres langues

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'alphabet Hangul.

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.Hangul

Ce package contient 156 langues OCR pour .NET :

  • Alphabet Hangul
  • Alphabet HangulBest
  • Alphabet HangulFast
  • HangulVerticalAlphabet
  • HangulVerticalAlphabetBest
  • HangulVerticalAlphabetFast

Télécharger

Pack de langue Hangul Alphabet [Alphabet coréen]

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

Installation

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

Install-Package IronOCR.Languages.Hangul

Exemple de code

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

// Ensure the IronOCR library is installed
// PM> Install-Package IronOcr.Languages.Hangul

using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of IronTesseract for performing OCR
        var Ocr = new IronTesseract();

        // Specify the Hangul language pack for better accuracy with Korean texts
        Ocr.Language = OcrLanguage.Hangul;

        // Load the image or PDF you want to read
        using (var Input = new OcrInput(@"images\Hangul.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

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

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Ensure the IronOCR library is installed
// PM> Install-Package IronOcr.Languages.Hangul

using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of IronTesseract for performing OCR
        var Ocr = new IronTesseract();

        // Specify the Hangul language pack for better accuracy with Korean texts
        Ocr.Language = OcrLanguage.Hangul;

        // Load the image or PDF you want to read
        using (var Input = new OcrInput(@"images\Hangul.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

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

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Ensure the IronOCR library is installed
' PM> Install-Package IronOcr.Languages.Hangul

Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of IronTesseract for performing OCR
		Dim Ocr = New IronTesseract()

		' Specify the Hangul language pack for better accuracy with Korean texts
		Ocr.Language = OcrLanguage.Hangul

		' Load the image or PDF you want to read
		Using Input = New OcrInput("images\Hangul.png")
			' Perform OCR to read the text from the image
			Dim Result = Ocr.Read(Input)

			' Extract the recognized text
			Dim AllText = Result.Text

			' Output the text to the console
			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.
  • OcrLanguage.Hangul : Ceci spécifie que le moteur OCR doit utiliser le pack de langue Hangul, ce qui optimise le moteur pour la reconnaissance de texte coréen.
  • OcrInput : Il s'agit d'un conteneur pour les images ou les PDF à traiter.
  • Ocr.Read() : Cette méthode effectue l'opération OCR et renvoie un objet résultat contenant le texte reconnu.