Turkish 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的內容。語言。土耳其語

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

  • 土耳其語
  • TurkishBest
  • TurkishFast

下載

土耳其語語言包[Türkçe]

安裝

第一步是使用以下NuGet套件管理器指令在您的.NET專案中安裝土耳其語OCR 套件。

Install-Package IronOcr.Languages.Turkish

程式碼範例

此 C# 程式碼範例示範如何從圖像或 PDF 文件中讀取土耳其語文字。

// Import the IronOcr namespace
using IronOcr;

class OCRExample
{
    static void Main()
    {
        // Create a new IronTesseract object
        var Ocr = new IronTesseract();

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

        // Define the input using a path to the image or PDF file
        using (var Input = new OcrInput(@"images\Turkish.png"))
        {
            // Perform the OCR reading operation
            var Result = Ocr.Read(Input);

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

            // Print the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class OCRExample
{
    static void Main()
    {
        // Create a new IronTesseract object
        var Ocr = new IronTesseract();

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

        // Define the input using a path to the image or PDF file
        using (var Input = new OcrInput(@"images\Turkish.png"))
        {
            // Perform the OCR reading operation
            var Result = Ocr.Read(Input);

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

            // Print the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

這段程式碼使用IronOCR設定 OCR 流程,從輸入影像中讀取土耳其文字。 然後,它將提取的文字列印到控制台。