Icelandic 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 l'islandais. Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET, et elle surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.
Contenu de IronOcr.Languages.Icelandais
Ce package contient 52 langues OCR for .NET :
- Islandais
- IcelandicBest
- IcelandicFast
Télécharger
Pack de langue islandaise [\u00cdslenska]
Installation
La première chose à faire est d'installer notre package OCR islandais sur votre projet .NET.
Install-Package IronOcr.Languages.Icelandic
Exemple de code
Cet exemple de code C# lit du texte islandais à partir d'une image ou d'un document PDF.
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the language to Icelandic
Ocr.Language = OcrLanguage.Icelandic;
// Load the image or PDF file to be processed
using (var Input = new OcrInput(@"images\Icelandic.png"))
{
// Perform OCR on the input file
var Result = Ocr.Read(Input);
// Extract all recognized text from the result
var AllText = Result.Text;
// Print the extracted text to the console
System.Console.WriteLine(AllText);
}
}
}
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the language to Icelandic
Ocr.Language = OcrLanguage.Icelandic;
// Load the image or PDF file to be processed
using (var Input = new OcrInput(@"images\Icelandic.png"))
{
// Perform OCR on the input file
var Result = Ocr.Read(Input);
// Extract all recognized text from the result
var AllText = Result.Text;
// Print the extracted text to the console
System.Console.WriteLine(AllText);
}
}
}
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create an instance of the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the language to Icelandic
Ocr.Language = OcrLanguage.Icelandic
' Load the image or PDF file to be processed
Using Input = New OcrInput("images\Icelandic.png")
' Perform OCR on the input file
Dim Result = Ocr.Read(Input)
' Extract all recognized text from the result
Dim AllText = Result.Text
' Print the extracted text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class
Explication
- La classe
IronTesseractfait partie de la bibliothèque IronOCR , conçue pour effectuer des opérations OCR. Ocr.Language = OcrLanguage.Icelandic;définit la langue OCR sur islandais.OcrInputprend le chemin d'accès au fichier d'entrée (une image ou un PDF) et le prépare pour le traitement.Ocr.Read(Input)traite le fichier d'entrée et renvoie le résultat OCR.Result.Textrécupère tout le texte reconnu à partir de l'entrée traitée.
Pour exécuter cet exemple correctement, assurez-vous d'avoir installé la bibliothèque IronOCR et son module de langue islandaise dans votre projet .NET.

