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 jezykach, 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 jezyka 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 instancje IronTesseract do przetwarzania OCR.
  • Ocr.Language jest ustawiony na Syriac, aby zapewnic dokladne rozpoznawanie tekstu w tym jezyku.
  • Wczytujemy obraz zawierajacy tekst syryjski do OcrInput i przetwarzamy go za pomoca Ocr.Read.
  • Rozpoznany tekst jest nastepnie przechowywany w Result.Text, co moze byc wykorzystane dalej w twojej aplikacji.