Italian 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 zu lesen, einschließlich Italienisch.
Es ist eine erweiterte Abspaltung von Tesseract, die exklusiv for .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Bezug auf Geschwindigkeit als auch Genauigkeit übertrifft.
Inhalt von IronOcr.Languages.Italian
Dieses Paket enthält 6 OCR-Sprachmodi for .NET:
- Italienisch
- ItalienischBest
- ItalienischFast
- ItalienischOld
- ItalienischOldBest
- ItalienischOldFast
Download
Italienisches Sprachpaket [italiano]
Installation
Das erste, was wir tun müssen, ist das Italienisch-OCR-Paket in Ihrem .NET-Projekt zu installieren.
Install-Package IronOcr.Languages.Italian
Beispielcode
Dieses C#-Code-Beispiel liest italienischen Text aus einem Bild oder PDF-Dokument.
// Include IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Italian
Ocr.Language = OcrLanguage.Italian;
// Read text from an image file
using (var Input = new OcrInput(@"images\Italian.png"))
{
// Perform OCR to get the text content from the image
var Result = Ocr.Read(Input);
// Get and print all the recognized text
var AllText = Result.Text;
Console.WriteLine(AllText);
}
}
}
// Include IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Italian
Ocr.Language = OcrLanguage.Italian;
// Read text from an image file
using (var Input = new OcrInput(@"images\Italian.png"))
{
// Perform OCR to get the text content from the image
var Result = Ocr.Read(Input);
// Get and print all the recognized text
var AllText = Result.Text;
Console.WriteLine(AllText);
}
}
}
' Include IronOcr library
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Set the OCR language to Italian
Ocr.Language = OcrLanguage.Italian
' Read text from an image file
Using Input = New OcrInput("images\Italian.png")
' Perform OCR to get the text content from the image
Dim Result = Ocr.Read(Input)
' Get and print all the recognized text
Dim AllText = Result.Text
Console.WriteLine(AllText)
End Using
End Sub
End Class
Erklärung:
- Verwendung von IronOCR : Die Bibliothek
IronOcrist enthalten, um deren OCR-Funktionen zu nutzen. - Erstellen einer IronTesseract-Instanz :
IronTesseractist eine Kernklasse, die für die OCR-Verarbeitung verwendet wird. - Spracheinstellung : OCR ist so eingestellt, dass die italienische Sprache mit
Ocr.Language = OcrLanguage.Italianverarbeitet wird. - Eingabe lesen : Es wird ein
OcrInput-Objekt erstellt, um die Bilddatei anzugeben. - OCR-Durchführung :
Ocr.Read(Input)führt den OCR-Prozess auf dem Eingabebild aus und gibt das Textergebnis zurück. - Ausgabe : Der resultierende Text wird in
AllTextgespeichert und in der Konsole angezeigt.
Stellen Sie sicher, dass der Dateipfad images\Italian.png korrekt ist und die Datei existiert, damit das Beispiel ordnungsgemäß funktioniert.

