Croatian 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的內容.語言.克羅埃西亞語

此軟體包包含對 49 種.NET OCR 語言的支持,其中包括:

  • 克羅埃西亞語
  • CroatianBest
  • CroatianFast

下載

克羅埃西亞語語言包[hrvatski jezik]

安裝

第一步是使用NuGet將克羅埃西亞語OCR 套件安裝到您的.NET專案中。

Install-Package IronOcr.Languages.Croatian

程式碼範例

這段 C# 程式碼範例從圖像或 PDF 文件中讀取克羅埃西亞語文字。

// Add the required namespace for IronOCR
using IronOcr;

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

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

        // Define the input image or PDF containing Croatian text
        using (var Input = new OcrInput(@"images\Croatian.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
// Add the required namespace for IronOCR
using IronOcr;

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

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

        // Define the input image or PDF containing Croatian text
        using (var Input = new OcrInput(@"images\Croatian.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

解釋

  • IronTesseract :這是用於執行 OCR 操作的主要類別。 它可以讀取圖像或 PDF 中的文本,並支援多種語言。
  • OcrInput :表示 OCR 的輸入來源,可以是影像或 PDF 檔案。
  • Ocr.Read :對指定的輸入執行 OCR 程序。
  • Result.Text :包含從輸入中提取的文本,然後將其列印到控制台。