使用 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.Dzongkha 的內容

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

  • 宗喀
  • DzongkhaBest
  • DzongkhaFast

下載

宗喀語語言

安裝

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

Install-Package IronOCR.Languages.Dzongkha

程式碼範例

此 C# 程式碼範例從圖像或 PDF 文件中讀取宗喀語文字。

// Ensure to install the IronOcr.Languages.Dzongkha package before use.
// Usage of IronOCR library for reading Dzongkha text from images or PDFs.

using IronOcr;

var Ocr = new IronTesseract();

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

// Specify the path to the input image file
using (var Input = new OcrInput(@"images\Dzongkha.png"))
{
    // Reading text from the input file
    var Result = Ocr.Read(Input);

    // Retrieve all the recognized text
    var AllText = Result.Text;

    // Output the recognized text
    Console.WriteLine(AllText);
}
// Ensure to install the IronOcr.Languages.Dzongkha package before use.
// Usage of IronOCR library for reading Dzongkha text from images or PDFs.

using IronOcr;

var Ocr = new IronTesseract();

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

// Specify the path to the input image file
using (var Input = new OcrInput(@"images\Dzongkha.png"))
{
    // Reading text from the input file
    var Result = Ocr.Read(Input);

    // Retrieve all the recognized text
    var AllText = Result.Text;

    // Output the recognized text
    Console.WriteLine(AllText);
}
' Ensure to install the IronOcr.Languages.Dzongkha package before use.
' Usage of IronOCR library for reading Dzongkha text from images or PDFs.

Imports IronOcr

Private Ocr = New IronTesseract()

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

' Specify the path to the input image file
Using Input = New OcrInput("images\Dzongkha.png")
	' Reading text from the input file
	Dim Result = Ocr.Read(Input)

	' Retrieve all the recognized text
	Dim AllText = Result.Text

	' Output the recognized text
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel