Tajik OCR in C# and .NET

Other versions of this document:

IronOCR is a C# software component allowing .NET coders to read text from images and PDF documents in 126 languages, including Tajik.

It is an advanced fork of Tesseract, built exclusively for .NET developers and regularly outperforms other Tesseract engines for both speed and accuracy.

Contents of IronOcr.Languages.Tajik

This package contains 40 OCR languages for .NET:

  • Tajik
  • TajikBest
  • TajikFast

Download

Tajik Language Pack [тоҷикӣ]

Installation

The first thing we have to do is install our Tajik OCR package to your .NET project.

Install-Package IronOCR.Languages.Tajik

Code Example

This C# code example reads Tajik text from an Image or PDF document.

// 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
  • Create an instance of IronTesseract to use the OCR functionalities.
  • Set the language property to OcrLanguage.Tajik to specify that the OCR should process in Tajik language.
  • Load the input image from which text needs to be extracted.
  • Ocr.Read method processes the image and returns the result containing the extracted text.
  • Access the Text property of the result to get all the detected text in the image.