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語言:

  • 印尼語
  • 印尼語Best
  • 印尼語Fast

下載

印尼語語言包 [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引擎來從圖像中讀取和識別印尼語文字。
  • 它使用Ocr.Read()來處理圖像並提取文字。
  • 被識別的文字儲存在AllText變數中,並列印到控制台。