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設計師從圖像和 PDF 文件中讀取 126 種語言(包括吉爾吉斯語)的文字。

它是 Tesseract 的一個高級分支,專為.NET開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。

IronOCR的內容。語言。吉爾吉斯語

此軟體包包含 43 種適用於.NET的 OCR 語言:

  • 吉爾吉斯
  • KyrgyzBest
  • KyrgyzFast

下載

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

安裝

我們首先需要做的就是將我們的吉爾吉斯語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);
        }
    }
}
$vbLabelText   $csharpLabel
  • 此程式碼區塊初始化一個 IronTesseract 物件以執行 OCR。
  • 它使用 OcrLanguage.Kyrgyz 枚舉將語言設定為吉爾吉斯語。
  • OcrInput 類別用於指定要從中提取文字的圖像的檔案路徑。
  • Ocr.Read(Input) 執行 OCR 流程,並提供包含擷取文字的結果,可透過 Result.Text 存取。 最後,Console.WriteLine(AllText) 將擷取的文字輸出到控制台。