C# 中的德文尖角體字母 OCR
Curtis Chau
已更新: 2026年8月2日
IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言的文字,包括哥德體字母。
它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Fraktur 的內容
此軟體包包含 70 種適用於 .NET 的 OCR 語言:
- FrakturAlphabet
- FrakturAlphabetBest
- FrakturAlphabetFast
下載
Fraktur 字母語言包[通用 Fraktur]
安裝
我們首先要做的是將我們的Fraktur Alphabet OCR 套件安裝到您的 .NET 專案中。
程式碼範例
這段 C# 程式碼範例從圖像或 PDF 文件中讀取哥德體字母文字。
// Requires the IronOcr NuGet package and the Fraktur language package to be installed.
using IronOcr;
class FrakturOCRExample
{
static void Main()
{
// Create an instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Fraktur
Ocr.Language = OcrLanguage.Fraktur;
// Load the image containing Fraktur text
using (var Input = new OcrInput(@"images\Fraktur.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Retrieve and display the recognized text
var AllText = Result.Text;
Console.WriteLine(AllText);
}
}
}' Requires the IronOcr NuGet package and the Fraktur language package to be installed.
Imports IronOcr
Module FrakturOCRExample
Sub Main()
' Create an instance of the IronTesseract class
Dim Ocr As New IronTesseract()
' Set the OCR language to Fraktur
Ocr.Language = OcrLanguage.Fraktur
' Load the image containing Fraktur text
Using Input As New OcrInput("images\Fraktur.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Retrieve and display the recognized text
Dim AllText = Result.Text
Console.WriteLine(AllText)
End Using
End Sub
End Module' Requires the IronOcr NuGet package and the Fraktur language package to be installed.
Imports IronOcr
Module FrakturOCRExample
Sub Main()
' Create an instance of the IronTesseract class
Dim Ocr As New IronTesseract()
' Set the OCR language to Fraktur
Ocr.Language = OcrLanguage.Fraktur
' Load the image containing Fraktur text
Using Input As New OcrInput("images\Fraktur.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Retrieve and display the recognized text
Dim AllText = Result.Text
Console.WriteLine(AllText)
End Using
End Sub
End Module在這個範例中
- 我們創建一個
IronTesseract物件作為我們的OCR引擎。 - 我們使用
OcrLanguage.Fraktur將語言設置更改為Fraktur。 - 我們將影像檔案(
OcrInput物件中。 Ocr.Read()方法處理輸入影像並返回OCR結果。- 最後,我們將提取的文字打印到控制台。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。