Breton OCR in C# and .NET

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

126 種其他語言

IronOCR 是一個 C# 軟體元件,讓 .NET 程式設計師能夠從 126 種語言(包括布列塔尼語)的圖片和 PDF 文件中讀取文字。 這是 Tesseract 的進階分支版本,專為 .NET 開發者打造,無論在速度或準確度方面,其表現均定期超越其他 Tesseract 引擎。

IronOcr.Languages.Breton 的內容

此套件包含 43 種適用於 .NET 的 OCR 語言:

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

下載

布列塔尼語語言套件 [brezhoneg]

安裝

我們首先必須將 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 方法會處理輸入的圖片並擷取文字,隨後將文字輸出至主控台。