Fraktur Alphabet OCR in C
This article was translated from English: Does it need improvement?
Translated
View the article in English
IronOCR是一個 C# 軟體元件,允許.NET設計師從圖像和 PDF 文件中讀取 126 種語言的文本,包括哥德字母。
它是 Tesseract 的一個高級分支,專為.NET開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOCR的內容。語言。 Fraktur
此軟體包包含 70 種適用於.NET的 OCR 語言:
- 哥德體字母表
- 哥德體字母表Best
- 哥德體字母表Fast
下載
Fraktur 字母語言包[通用 Fraktur]
安裝
我們首先要做的是將我們的Fraktur Alphabet OCR 包安裝到您的.NET專案中。
Install-Package IronOcr.Languages.Fraktur
程式碼範例
這段 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.
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
Friend Class FrakturOCRExample
Shared Sub Main()
' Create an instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Set the OCR language to Fraktur
Ocr.Language = OcrLanguage.Fraktur
' Load the image containing Fraktur text
Using Input = 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 Class
$vbLabelText
$csharpLabel
在這個例子中:
- 我們創建了一個
IronTesseract對象,作為我們的 OCR 引擎。 - 我們使用
OcrLanguage.Fraktur將語言設定更改為 Fraktur。 - 我們將圖像檔案(
@"images\Fraktur.png")載入到OcrInput物件中。 Ocr.Read()方法處理輸入影像並傳回 OCR 結果。 最後,我們將提取的文字列印到控制台。

