C# 和 .NET 中的印尼語 OCR
This article was translated from English: Does it need improvement?
TranslatedView the article in English
Other versions of this document:
IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言(包括印尼語)的文字。 它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Indonesian 的內容
此軟體包包含 55 種適用於 .NET 的 OCR 語言:
- 印尼語
- IndonesianBest
- IndonesianFast
下載
印尼語語言包 [印尼語]
安裝
我們首先需要做的就是將我們的印尼語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變數中,並列印到控制台。





