Russian OCR in C# and .NET
Autres versions de ce document :
IronOCR est un composant logiciel C# permettant aux développeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, dont le russe.
Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET et qui surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.
Contenu de IronOcr.Languages.Russe
Ce package contient 46 langues OCR pour .NET :
- Russe
- RussianBest
- RussianFast
Télécharger
Pack de langue russe
Installation
La première chose à faire est d'installer notre package OCR russe sur votre projet .NET.
Install-Package IronOcr.Languages.Russian
Exemple de code
Cet exemple de code C# lit du texte russe à partir d'une image ou d'un document PDF.
// 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
- Le code ci-dessus importe la bibliothèque IronOCR nécessaire et initialise
IronTesseract, une classe utilisée pour effectuer des tâches OCR. - Il définit la langue de l'OCR sur le russe en utilisant
Ocr.Language = OcrLanguage.Russian. - Il ouvre ensuite le fichier image spécifié
Russian.pngen utilisant la classeOcrInput. - La méthode
Readde l'objetOcrest utilisée pour traiter l'image et reconnaître le texte, - Enfin, il extrait le texte reconnu du
Result.Textet le renvoie.

