C# 和 .NET 中的布列塔尼語 OCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

還有126種語言

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

IronOcr.Languages.Breton 的內容

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

  • 布列塔尼語
  • 布列塔尼語Best
  • 布列塔尼語Fast

下載

布列塔尼語語言包 [英語]

安裝

我們首先需要做的就是將我們的Breton OCR 套件安裝到您的 .NET 專案中。

Install-Package IronOCR.Languages.Breton

程式碼範例

此 C# 程式碼範例從圖像或 PDF 文件中讀取布列塔尼語文字。

// Import the IronOCR namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

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

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

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOCR namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

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

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

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOCR namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Initialize the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

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

		' Read text from a Breton image or PDF document
		Using Input = New OcrInput("images\Breton.png")
			' Perform OCR on the input
			Dim Result = Ocr.Read(Input)

			' Extract text from the OCR result
			Dim AllText = Result.Text

			' Output the extracted text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • 此範例示範如何使用 IronOCR 函式庫對布列塔尼文字影像執行 OCR。 IronTesseract提供核心 OCR 功能。
  • OcrInput是透過指向包含布列塔尼語文字的圖像的路徑來建立的。
  • Read方法處理輸入圖像並提取文本,然後將文本輸出到控制台。