Faroese 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.Faroese 的內容
此套件包含 46 種適用於 .NET 的 OCR 語言:
- 法羅語
- 法羅語最佳
- 法羅語Fast
下載
法羅語語言套件 [føroyskt]
安裝
首先,請將法羅語 OCR 套件安裝至您的 .NET 專案中:
Install-Package IronOcr.Languages.Faroese
程式碼範例
此 C# 程式碼範例用於從圖片或 PDF 文件中讀取法羅語文字。
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Specify the language to use for OCR
// In this case, we're using Faroese
Ocr.Language = OcrLanguage.Faroese;
// Use a using statement for automatic resource management
using (var Input = new OcrInput(@"images\Faroese.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Print the extracted text to console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Specify the language to use for OCR
// In this case, we're using Faroese
Ocr.Language = OcrLanguage.Faroese;
// Use a using statement for automatic resource management
using (var Input = new OcrInput(@"images\Faroese.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Print the extracted text to console
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()
' Specify the language to use for OCR
' In this case, we're using Faroese
Ocr.Language = OcrLanguage.Faroese
' Use a using statement for automatic resource management
Using Input = New OcrInput("images\Faroese.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Extract the recognized text
Dim AllText = Result.Text
' Print the extracted text to console
Console.WriteLine(AllText)
End Using
End Sub
End Class
$vbLabelText
$csharpLabel
IronTesseract:此物件作為核心 OCR 引擎。Ocr.Language:將 OCR 設定為法羅語。 請確保已安裝法羅語語言套件。OcrInput:提供用於 OCR 的輸入檔案(圖片或 PDF)。Ocr.Read:處理輸入內容並產生 OCR 結果。Result.Text:從 OCR 操作中擷取文字資訊。

