Indonesian OCR in C# and .NET
This article was translated from English: Does it need improvement?
Translated
View the article in English
本文件的其他版本:
IronOCR 是一個 C# 軟體元件,讓 .NET 程式設計師能夠從 126 種語言(包括印尼語)的圖片和 PDF 文件中讀取文字。 這是 Tesseract 的進階分支版本,專為 .NET 開發人員打造,無論在速度或準確度方面,其表現均經常優於其他 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變數中,並 PRINT 至控制台。

