Azerbaijani OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR 是一個 C# 軟件組件,使 .NET 編碼人員可以用 126 種語言從圖像和 PDF 文檔中讀取文本,包括阿塞拜疆語。

它是一個專為 .NET 開發者設計的 Tesseract 高級分支,在速度和準確性方面經常優於其他 Tesseract 引擎。

IronOcr.Languages.Azerbaijani 的內容

此包中包含 138 種適用於 .NET 的 OCR 語言:

  • 阿塞拜疆語
  • 阿塞拜疆語最佳
  • 阿塞拜疆語快速
  • 阿塞拜疆語西里爾語
  • 阿塞拜疆語西里爾語最佳
  • 阿塞拜疆語西里爾語快速

下載

阿塞拜疆語言包 style='white-space:default'>[azərbaycan dili]

安裝

首先,我們需要將阿塞拜疆 OCR 包安裝到您的 .NET 項目中。

Install-Package IronOCR.Languages.Azerbaijani

代碼示例

此 C# 代碼示例從圖像或 PDF 文檔中讀取阿塞拜疆語文本。

// Ensure the IronOCR Azerbaijani language package is installed
// PM> Install-Package IronOCR.Languages.Azerbaijani

using IronOcr;

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

        // Specify the language to be Azerbaijani
        Ocr.Language = OcrLanguage.Azerbaijani;

        // Provide the path to the image file containing Azerbaijani text
        using (var Input = new OcrInput(@"images\Azerbaijani.png"))
        {
            // Process the image to extract text
            var Result = Ocr.Read(Input);

            // Extracted text is stored in Result.Text
            var AllText = Result.Text;

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
// Ensure the IronOCR Azerbaijani language package is installed
// PM> Install-Package IronOCR.Languages.Azerbaijani

using IronOcr;

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

        // Specify the language to be Azerbaijani
        Ocr.Language = OcrLanguage.Azerbaijani;

        // Provide the path to the image file containing Azerbaijani text
        using (var Input = new OcrInput(@"images\Azerbaijani.png"))
        {
            // Process the image to extract text
            var Result = Ocr.Read(Input);

            // Extracted text is stored in Result.Text
            var AllText = Result.Text;

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
' Ensure the IronOCR Azerbaijani language package is installed
' PM> Install-Package IronOCR.Languages.Azerbaijani

Imports IronOcr

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

		' Specify the language to be Azerbaijani
		Ocr.Language = OcrLanguage.Azerbaijani

		' Provide the path to the image file containing Azerbaijani text
		Using Input = New OcrInput("images\Azerbaijani.png")
			' Process the image to extract text
			Dim Result = Ocr.Read(Input)

			' Extracted text is stored in Result.Text
			Dim AllText = Result.Text

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

在此示例中,我們初始化 IronTesseract 對象並將其語言設置為阿塞拜疆語。 OcrInput 實例用於從指定的文件路徑讀取圖像。 Ocr.Read 方法處理圖像以提取文本,可通過 Result.Text 屬性訪問該文本。 這樣就可以輕鬆輸出或進一步處理。