Tajik OCR in C# and .NET

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

IronOCR to komponent oprogramowania C# pozwalający programistom .NET na odczytywanie tekstu z obrazów i dokumentów PDF w 126 językach, w tym w tadżyckim.

Jest to zaawansowany fork Tesseracta, zbudowany wyłącznie dla deweloperów .NET i regularnie przewyższający inne silniki Tesseract pod względem szybkości i dokładności.

Zawartość IronOcr.Languages.Tajik

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

  • Tadżycki
  • TadżyckiBest
  • TadżyckiFast

Pobieranie

Tajik Language Pack [тоҷикӣ]

Instalacja

Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie naszego pakietu OCR Tadżycki w projekcie .NET.

Install-Package IronOcr.Languages.Tajik

Przyklad kodu

Ten przykład kodu C# odczytuje tekst tadżycki z obrazu lub dokumentu PDF.

// Import the IronOcr namespace to use its functionality
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract engine
        var Ocr = new IronTesseract();

        // Specify the language to use for OCR as Tajik
        Ocr.Language = OcrLanguage.Tajik;

        // Load the image file where the OCR is to be performed
        using (var Input = new OcrInput(@"images\Tajik.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract the text from the OCR result
            var AllText = Result.Text;

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace to use its functionality
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract engine
        var Ocr = new IronTesseract();

        // Specify the language to use for OCR as Tajik
        Ocr.Language = OcrLanguage.Tajik;

        // Load the image file where the OCR is to be performed
        using (var Input = new OcrInput(@"images\Tajik.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract the text from the OCR result
            var AllText = Result.Text;

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace to use its functionality
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create an instance of IronTesseract engine
		Dim Ocr = New IronTesseract()

		' Specify the language to use for OCR as Tajik
		Ocr.Language = OcrLanguage.Tajik

		' Load the image file where the OCR is to be performed
		Using Input = New OcrInput("images\Tajik.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Extract the text from the OCR result
			Dim AllText = Result.Text

			' Output the text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Utwórz instancję IronTesseract, aby używać funkcjonalności OCR.
  • Ustaw właściwość języka na OcrLanguage.Tajik, aby określić, że OCR powinien działać w języku tadżyckim.
  • Załaduj obraz wejściowy, z którego należy wyodrębnić tekst.
  • Metoda Ocr.Read przetwarza obraz i zwraca wynik zawierający wyodrębniony tekst.
  • Uzyskaj dostęp do właściwości Text wyniku, aby dostać wszystkie wykryte teksty na obrazie.