Syriac 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# pozwalajacym programistom .NET czytac tekst z obrazow i dokumentow PDF w 126 językach, w tym po syryjsku.

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.

Zawartosc IronOcr.Languages.Syriac

Pakiet ten zawiera 108 języków OCR dla .NET:

  • Syryjski
  • SyryjskiNajlepszy
  • SyryjskiSzybki
  • AlfabetSyryjski
  • AlfabetSyryjskiNajlepszy
  • AlfabetSyryjskiSzybki

Pobieranie

Pakiet języka syryjskiego [Syryjski]

  • Pobierz jako Zip
  • Zainstaluj za pomoca NuGet

Instalacja

Pierwszym krokiem jest zainstalowanie pakietu OCR Syriac w twoim projekcie .NET.

Install-Package IronOcr.Languages.Syriac

Przyklad kodu

Ten przyklad kodu C# czyta tekst syryjski z obrazu lub dokumentu PDF.

// Import the IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Instantiate the IronTesseract object
        var Ocr = new IronTesseract();

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

        // Create an OCR input from an image file
        using (var Input = new OcrInput(@"images\Syriac.png"))
        {
            // Read the image and extract the text
            var Result = Ocr.Read(Input);

            // Retrieve the full recognized text
            var AllText = Result.Text;

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Instantiate the IronTesseract object
        var Ocr = new IronTesseract();

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

        // Create an OCR input from an image file
        using (var Input = new OcrInput(@"images\Syriac.png"))
        {
            // Read the image and extract the text
            var Result = Ocr.Read(Input);

            // Retrieve the full recognized text
            var AllText = Result.Text;

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr library
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Instantiate the IronTesseract object
		Dim Ocr = New IronTesseract()

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

		' Create an OCR input from an image file
		Using Input = New OcrInput("images\Syriac.png")
			' Read the image and extract the text
			Dim Result = Ocr.Read(Input)

			' Retrieve the full recognized text
			Dim AllText = Result.Text

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

W tym przykładzie:

  • Tworzymy instancję IronTesseract w celu przetworzenia OCR.
  • Ocr.Language jest ustawione na Syriac, aby zapewnić dokładne rozpoznawanie tekstu w tym języku.
  • Wczytujemy obraz zawierający tekst w języku syryjskim do OcrInput i przetwarzamy go za pomocą Ocr.Read.
  • Rozpoznany tekst jest następnie zapisywany w Result.Text, skąd można go dalej wykorzystać w aplikacji.