Indonesian OCR in C# and .NET

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

IronOCR 是一個 C# 軟體元件,允許 .NET 開發人員從包含印尼語在內的 126 種語言的圖片和 PDF 文件中讀取文本。 它是一個專為 .NET 開發者設計的 Tesseract 高級分支,在速度和準確性方面經常優於其他 Tesseract 引擎。

IronOcr.Languages.Indonesian 的內容

此套件包含 55 種 .NET OCR 語言:

  • 印尼語
  • 印尼語最佳
  • 印尼語快速

下載

印尼語語言包 [Bahasa Indonesia]

安裝

我們要做的第一件事是將我們的 印尼語 OCR 套件安裝到您的 .NET 項目中。

Install-Package IronOCR.Languages.Indonesian

代碼示例

此 C# 代碼示例從圖像或 PDF 文件中讀取印尼語文本。

// Ensure the IronOCR package is installed:
// PM> Install-Package IronOcr.Languages.Indonesian

using IronOcr;

var Ocr = new IronTesseract();
// Set the OCR language to Indonesian
Ocr.Language = OcrLanguage.Indonesian;

// Use the OCR engine to read text from an image
using (var Input = new OcrInput(@"images\Indonesian.png"))
{
    // Perform OCR on the given input
    var Result = Ocr.Read(Input);

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

    // Print the recognized text to the console
    Console.WriteLine(AllText);
}
// Ensure the IronOCR package is installed:
// PM> Install-Package IronOcr.Languages.Indonesian

using IronOcr;

var Ocr = new IronTesseract();
// Set the OCR language to Indonesian
Ocr.Language = OcrLanguage.Indonesian;

// Use the OCR engine to read text from an image
using (var Input = new OcrInput(@"images\Indonesian.png"))
{
    // Perform OCR on the given input
    var Result = Ocr.Read(Input);

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

    // Print the recognized text to the console
    Console.WriteLine(AllText);
}
' Ensure the IronOCR package is installed:
' PM> Install-Package IronOcr.Languages.Indonesian

Imports IronOcr

Private Ocr = New IronTesseract()
' Set the OCR language to Indonesian
Ocr.Language = OcrLanguage.Indonesian

' Use the OCR engine to read text from an image
Using Input = New OcrInput("images\Indonesian.png")
	' Perform OCR on the given input
	Dim Result = Ocr.Read(Input)

	' Retrieve all recognized text
	Dim AllText = Result.Text

	' Print the recognized text to the console
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel
  • 此腳本演示了如何使用 IronTesseract OCR 引擎從圖像中讀取和識別印尼語文本。
  • 它使用 OcrInput 類來指定源圖像,然後使用 Ocr.Read() 來處理圖像並提取文本。
  • 認識的文本存儲在 AllText 變量中並打印到控制台。