使用 C# 和 .NET 进行叙利亚语 OCR 识别
This article was translated from English: Does it need improvement?
TranslatedView the article in English
IronOCR 是一个 C# 软件组件,允许 .NET 程序员从图像和 PDF 文档中读取 126 种语言(包括叙利亚语)的文本。
它是 Tesseract 的一个高级分支,专为 .NET 开发人员构建,在速度和准确性方面通常优于其他 Tesseract 引擎。
IronOcr.Languages.Syriac 的内容
此软件包包含 108 种适用于 .NET 的 OCR 语言:
叙利亚语 叙利亚语Best 叙利亚语Fast 叙利亚字母
- 叙利亚字母表最佳
- 叙利亚字母表快速
下载
叙利亚语语言包 [叙利亚语]
下载为Zip 文件
- 使用NuGet安装
安装
第一步是在您的 .NET 项目中安装叙利亚语OCR 包。
Install-Package IronOCR.Languages.Syriac
代码示例
这段 C# 代码示例从图像或 PDF 文档中读取叙利亚语文本。
// Import the IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Instantiate the IronTesseract object
var Ocr = new IronTesseract();
// Set the language to Syriac
Ocr.Language = OcrLanguage.Syriac;
// Create an OCR input from an image file
using (var Input = new OcrInput(@"images\Syriac.png"))
{
// Read the image and extract the text
var Result = Ocr.Read(Input);
// Retrieve the full recognized text
var AllText = Result.Text;
// Output the text to the console
Console.WriteLine(AllText);
}
}
}// Import the IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Instantiate the IronTesseract object
var Ocr = new IronTesseract();
// Set the language to Syriac
Ocr.Language = OcrLanguage.Syriac;
// Create an OCR input from an image file
using (var Input = new OcrInput(@"images\Syriac.png"))
{
// Read the image and extract the text
var Result = Ocr.Read(Input);
// Retrieve the full recognized text
var AllText = Result.Text;
// Output the text to the console
Console.WriteLine(AllText);
}
}
}' Import the IronOcr library
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Instantiate the IronTesseract object
Dim Ocr = New IronTesseract()
' Set the language to Syriac
Ocr.Language = OcrLanguage.Syriac
' Create an OCR input from an image file
Using Input = New OcrInput("images\Syriac.png")
' Read the image and extract the text
Dim Result = Ocr.Read(Input)
' Retrieve the full recognized text
Dim AllText = Result.Text
' Output the text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class$vbLabelText $csharpLabel
在此示例中:
- 我们创建了一个
IronTesseract实例来处理 OCR。 Ocr.Language设置为Syriac,以确保对该语言进行准确的文本识别。- 我们将包含叙利亚语文本的图像加载到
OcrInput中,并使用Ocr.Read对其进行处理。 - 然后,将识别出的文本存储在
Result.Text中,以便在您的应用程序中进一步使用。





