Russian OCR in C# and .NET
Andere Versionen dieses Dokuments:
IronOCR ist eine C# Softwarekomponente, die es .NET-Entwicklern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Russisch, zu lesen.
Es ist ein erweiterter Fork von Tesseract, der ausschließlich for .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Bezug auf Geschwindigkeit als auch Genauigkeit übertrifft.
Inhalt von IronOcr.Languages.Russian
Dieses Paket enthält 46 OCR-Sprachen for .NET:
- Russisch
- RussianBest
- RussianFast
Download
Russisches Sprachpaket [русский язык]
Installation
Das Erste, was wir tun müssen, ist, unser Russisches OCR-Paket in Ihr .NET-Projekt zu installieren.
Install-Package IronOcr.Languages.Russian
Beispielcode
Dieses C# Codebeispiel liest russischen Text aus einem Bild oder PDF-Dokument.
// Import the IronOCR namespace
using IronOcr;
class Program
{
static void Main()
{
// Initialize IronTesseract, an OCR object
var Ocr = new IronTesseract();
// Set the OCR language to Russian
Ocr.Language = OcrLanguage.Russian;
// Create an OCR input for the Russian image
using (var Input = new OcrInput(@"images\Russian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all the recognized text
var AllText = Result.Text;
// Output the recognized text
System.Console.WriteLine(AllText);
}
}
}
// Import the IronOCR namespace
using IronOcr;
class Program
{
static void Main()
{
// Initialize IronTesseract, an OCR object
var Ocr = new IronTesseract();
// Set the OCR language to Russian
Ocr.Language = OcrLanguage.Russian;
// Create an OCR input for the Russian image
using (var Input = new OcrInput(@"images\Russian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all the recognized text
var AllText = Result.Text;
// Output the recognized text
System.Console.WriteLine(AllText);
}
}
}
' Import the IronOCR namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Initialize IronTesseract, an OCR object
Dim Ocr = New IronTesseract()
' Set the OCR language to Russian
Ocr.Language = OcrLanguage.Russian
' Create an OCR input for the Russian image
Using Input = New OcrInput("images\Russian.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Extract all the recognized text
Dim AllText = Result.Text
' Output the recognized text
System.Console.WriteLine(AllText)
End Using
End Sub
End Class
Der obige Code importiert die notwendige IronOCR Bibliothek und initialisiert IronTesseract, eine Klasse, die zur Durchführung von OCR-Aufgaben verwendet wird.
- Es stellt die Sprache für OCR auf Russisch ein, indem es
Ocr.Language = OcrLanguage.Russianverwendet. Anschließend wird die angegebene BilddateiRussian.pngmithilfe der KlasseOcrInputgeöffnet. Die MethodeReaddes ObjektsOcrdient der Bildverarbeitung und Texterkennung. Schließlich extrahiert es den erkannten Text aus demResult.Textund gibt ihn aus.

