Malayalam 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.Malayalam 的內容
此套件包含 126 種適用於 .NET 的 OCR 語言:
- 馬拉雅拉姆語
- 馬拉雅拉姆語Best
- 馬拉雅拉姆語Fast
- 馬拉雅拉姆語字母
- 馬拉雅拉姆語字母Best
- 馬拉雅拉姆語字母Fast
下載
馬拉雅拉姆語語言套件 [മലയാളം]
安裝
我們首先必須將馬拉雅拉姆語 OCR 套件安裝至您的 .NET 專案中。
Install-Package IronOcr.Languages.Malayalam
程式碼範例
此 C# 程式碼範例會從圖片或 PDF 文件中讀取馬拉雅拉姆語文字。
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Malayalam
Ocr.Language = OcrLanguage.Malayalam;
// Process the image to extract text using OCR
using (var Input = new OcrInput(@"images\Malayalam.png"))
{
// Read the text from the input object
var Result = Ocr.Read(Input);
// Extract and store the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Malayalam
Ocr.Language = OcrLanguage.Malayalam;
// Process the image to extract text using OCR
using (var Input = new OcrInput(@"images\Malayalam.png"))
{
// Read the text from the input object
var Result = Ocr.Read(Input);
// Extract and store the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of IronTesseract
Dim Ocr = New IronTesseract()
' Set the language to Malayalam
Ocr.Language = OcrLanguage.Malayalam
' Process the image to extract text using OCR
Using Input = New OcrInput("images\Malayalam.png")
' Read the text from the input object
Dim Result = Ocr.Read(Input)
' Extract and store the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
End Sub
End Class
$vbLabelText
$csharpLabel
- 此程式碼範例展示如何設定 IronOCR,對指定之馬拉雅拉姆語圖片執行 OCR 處理。
OcrInput物件用於載入圖片檔案。Ocr.Read函式會處理圖片並擷取其中的文字。- 擷取的文字會儲存於
AllText並 PRINT 至控制台。

