使用 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