芬兰语 OCR 的 C# 和 .NET
This article was translated from English: Does it need improvement?
TranslatedView the article in English
Other versions of this document:
IronOCR 是一个 C# 软件组件,允许 .NET 程序员从图像和 PDF 文档中读取 126 种语言(包括芬兰语)的文本。
它是 Tesseract 的一个高级分支,专为 .NET 开发人员构建,在速度和准确性方面通常优于其他 Tesseract 引擎。
IronOcr.Languages.Finnish 的内容
此软件包包含 46 种适用于 .NET 的 OCR 语言:
芬兰语
- FinnishBest
- 芬兰快餐
下载
芬兰语语言包[芬兰语]
安装
我们首先需要做的是将我们的芬兰语OCR 包安装到您的 .NET 项目中。
Install-Package IronOCR.Languages.Finnish
代码示例
这段 C# 代码示例从图像或 PDF 文档中读取芬兰语文本。
// Ensure you have installed the IronOcr.Languages.Finnish package before using this code.
// You can install it via NuGet package manager.
using IronOcr;
var Ocr = new IronTesseract(); // Create a new instance of the IronTesseract OCR engine
Ocr.Language = OcrLanguage.Finnish; // Set the language of the OCR engine to Finnish
// Using a using statement to ensure the OcrInput gets disposed of correctly
using (var Input = new OcrInput(@"images\Finnish.png")) // Path to the image/PDF containing Finnish text
{
var Result = Ocr.Read(Input); // Perform OCR on the input file
var AllText = Result.Text; // Extract the recognized text as a string
// Output or process the extracted text as required
Console.WriteLine(AllText); // Example of outputting the text to the console
}// Ensure you have installed the IronOcr.Languages.Finnish package before using this code.
// You can install it via NuGet package manager.
using IronOcr;
var Ocr = new IronTesseract(); // Create a new instance of the IronTesseract OCR engine
Ocr.Language = OcrLanguage.Finnish; // Set the language of the OCR engine to Finnish
// Using a using statement to ensure the OcrInput gets disposed of correctly
using (var Input = new OcrInput(@"images\Finnish.png")) // Path to the image/PDF containing Finnish text
{
var Result = Ocr.Read(Input); // Perform OCR on the input file
var AllText = Result.Text; // Extract the recognized text as a string
// Output or process the extracted text as required
Console.WriteLine(AllText); // Example of outputting the text to the console
}' Ensure you have installed the IronOcr.Languages.Finnish package before using this code.
' You can install it via NuGet package manager.
Imports IronOcr
Private Ocr = New IronTesseract() ' Create a new instance of the IronTesseract OCR engine
Ocr.Language = OcrLanguage.Finnish ' Set the language of the OCR engine to Finnish
' Using a using statement to ensure the OcrInput gets disposed of correctly
Using Input = New OcrInput("images\Finnish.png") ' Path to the image/PDF containing Finnish text
Dim Result = Ocr.Read(Input) ' Perform OCR on the input file
Dim AllText = Result.Text ' Extract the recognized text as a string
' Output or process the extracted text as required
Console.WriteLine(AllText) ' Example of outputting the text to the console
End Using$vbLabelText $csharpLabel





