Hangul Alphabet OCR in C# and .NET

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

126 wiecej jeżyków

IronOCR jest komponentem oprogramowania C# pozwalającym programistom .NET na odczytywanie tekstu z obrazów i dokumentów PDF w 126 językach, w tym w alfabecie Hangul.

Jest to zaawansowany fork Tesseract, stworzony wyłącznie dla programistów .NET i regularnie przewyższa inne silniki Tesseract zarówno pod względem szybkości, jak i dokładności.

Zawartość IronOcr.Languages.Hangul

Ten pakiet zawiera 156 języków OCR dla .NET:

  • HangulAlphabet
  • HangulAlphabetBest
  • HangulAlphabetFast
  • HangulVerticalAlphabet
  • HangulVerticalAlphabetBest
  • HangulVerticalAlphabetFast

Pobieranie

Pakiet językowy Alfabetu Hangul [Alfabet koreański]

Instalacja

Pierwszym krokiem jest zainstalowanie pakietu OCR Hangul Alphabet w swoim projekcie .NET.

Install-Package IronOcr.Languages.Hangul

Przyklad kodu

Ten przykład kodu C# odczytuje tekst alfabetu Hangul z obrazu lub dokumentu 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

Wyjaśnienie:

  • IronTesseract: To główna klasa używana do wykonywania operacji OCR.
  • OcrLanguage.Hangul: To określa, że silnik OCR powinien używać pakietu językowego Hangul, co optymalizuje silnik do rozpoznawania tekstu w języku koreańskim.
  • OcrInput: To jest kontener na obrazy lub pliki PDF do przetworzenia.
  • Ocr.Read(): Ta metoda wykonuje operację OCR i zwraca obiekt wynikowy zawierający rozpoznany tekst.