Maltese OCR in C# and .NET
Curtis Chau
已更新: 2026年8月2日
本文檔的其他版本:
IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言(包括馬耳他語)的文字。
它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.馬耳他語的內容
此軟體包包含 46 種適用於 .NET 的 OCR 語言:
- 馬爾他語
- 馬爾他語Best
- 馬爾他語Fast
下載
馬耳他語語言包 [Malti]
安裝
我們首先需要做的就是將我們的馬耳他語OCR 套件安裝到您的 .NET 專案中。
程式碼範例
這段 C# 程式碼範例從圖像或 PDF 文件中讀取馬耳他語文字。
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Maltese
Ocr.Language = OcrLanguage.Maltese;
// Define the input image or PDF document
using (var Input = new OcrInput(@"images\Maltese.png"))
{
// Perform OCR on the input and retrieve the result
var Result = Ocr.Read(Input);
// Get all the recognized text
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace
Imports IronOcr
Class Program
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the OCR language to Maltese
Ocr.Language = OcrLanguage.Maltese
' Define the input image or PDF document
Using Input As New OcrInput("images\Maltese.png")
' Perform OCR on the input and retrieve the result
Dim Result = Ocr.Read(Input)
' Get all the recognized text
Dim AllText = Result.Text
' Output the recognized text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class' Import the IronOcr namespace
Imports IronOcr
Class Program
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the OCR language to Maltese
Ocr.Language = OcrLanguage.Maltese
' Define the input image or PDF document
Using Input As New OcrInput("images\Maltese.png")
' Perform OCR on the input and retrieve the result
Dim Result = Ocr.Read(Input)
' Get all the recognized text
Dim AllText = Result.Text
' Output the recognized text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class在此範例中,IronTesseract OCR引擎用於從名為Maltese.png的影像檔中讀取文字。 識別出的文字隨後會列印到控制台。 請確保圖像路徑正確,並且圖像檔案包含馬耳他語文字,以便 OCR 能夠有效運作。 using語句確保資源在不再需要時能妥善釋放。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。