Kyrgyz OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
本文件的其他版本:

IronOCR 是一個 C# 軟體元件,讓 .NET 程式設計師能夠從 126 種語言(包括吉爾吉斯語)的圖片和 PDF 文件中讀取文字。

這是 Tesseract 的進階分支版本,專為 .NET 開發人員打造,無論在速度或準確度方面,其表現均經常優於其他 Tesseract 引擎。

IronOcr.Languages.Kyrgyz 的內容

此套件包含 43 種適用於 .NET 的 OCR 語言:

  • 吉爾吉斯語
  • 吉爾吉斯語Best
  • 吉爾吉斯語Fast

下載

吉爾吉斯語語言包 [Кыргызча]

安裝

我們首先必須將吉爾吉斯語 OCR 套件安裝至您的 .NET 專案中。

Install-Package IronOcr.Languages.Kyrgyz

程式碼範例

此 C# 程式碼範例用於從圖片或 PDF 文件中讀取吉爾吉斯語文字。

// Import the IronOcr namespace
using IronOcr;

public class KyrgyzOcrExample
{
    public void PerformOcr()
    {
        // Initialize IronTesseract for OCR operations
        var Ocr = new IronTesseract();

        // Set the OCR language to Kyrgyz
        Ocr.Language = OcrLanguage.Kyrgyz;

        // Define the input using an image file path
        using (var Input = new OcrInput(@"images\Kyrgyz.png"))
        {
            // Perform OCR and get the result
            var Result = Ocr.Read(Input);

            // Extracted text from the image
            string AllText = Result.Text;

            // Output the extracted text (or use it in your application as needed)
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

public class KyrgyzOcrExample
{
    public void PerformOcr()
    {
        // Initialize IronTesseract for OCR operations
        var Ocr = new IronTesseract();

        // Set the OCR language to Kyrgyz
        Ocr.Language = OcrLanguage.Kyrgyz;

        // Define the input using an image file path
        using (var Input = new OcrInput(@"images\Kyrgyz.png"))
        {
            // Perform OCR and get the result
            var Result = Ocr.Read(Input);

            // Extracted text from the image
            string AllText = Result.Text;

            // Output the extracted text (or use it in your application as needed)
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Public Class KyrgyzOcrExample
	Public Sub PerformOcr()
		' Initialize IronTesseract for OCR operations
		Dim Ocr = New IronTesseract()

		' Set the OCR language to Kyrgyz
		Ocr.Language = OcrLanguage.Kyrgyz

		' Define the input using an image file path
		Using Input = New OcrInput("images\Kyrgyz.png")
			' Perform OCR and get the result
			Dim Result = Ocr.Read(Input)

			' Extracted text from the image
			Dim AllText As String = Result.Text

			' Output the extracted text (or use it in your application as needed)
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • 此程式碼區塊會初始化一個 IronTesseract 物件以執行 OCR。
  • 透過 OcrLanguage.Kyrgyz 枚舉將語言設定為吉爾吉斯語。
  • OcrInput 類別用於指定將從中擷取文字的圖片檔案路徑。
  • Ocr.Read(Input) 執行 OCR 處理,並透過 Result.Text 提供包含擷取文字的結果。
  • 最後,Console.WriteLine(AllText) 會將擷取的文字輸出至控制台。