C# 和 .NET 中的克羅埃西亞語 OCR

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

在克羅埃西亞語 新增 125 種 OCR 語言

IronOCR 是一個 C# 軟體元件,允許 .NET 開發人員從圖像和 PDF 文件中讀取 126 種語言(包括克羅埃西亞語)的文字。 它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。

IronOcr.Languages.Croatian 的內容

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

  • 克羅埃西亞語
  • CroatianBest
  • CroatianFast

下載

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

安裝

第一步是使用 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);
        }
    }
}
' Add the required namespace for IronOCR
Imports IronOcr

Friend Class OCRExample
	Public Shared Sub Main()
		' Create a new IronTesseract instance
		Dim Ocr = New IronTesseract()

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

		' Define the input image or PDF containing Croatian text
		Using Input = New OcrInput("images\Croatian.png")
			' Perform OCR on the input
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

			' Output the recognized text to the console
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

說明

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