Welsh 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 Walisisch, zu lesen. Es ist eine fortschrittliche Abspaltung von Tesseract, die ausschließlich for .NET-Entwickler gebaut wurde und regelmäßig andere Tesseract-Engines sowohl in Geschwindigkeit als auch Genauigkeit übertrifft.
Inhalt von IronOcr.Languages.Welsh
Dieses Paket enthält drei Versionen der walisischen OCR-Sprache for .NET:
- Walisisch
- WelshBest
- WelshFast
Download
Walisisches Sprachpaket [Cymraeg]
Installation
Der erste Schritt ist die Installation des Walisisch-OCR-Pakets in Ihrem .NET-Projekt.
Install-Package IronOcr.Languages.Welsh
Beispielcode
Dieses C# Codebeispiel zeigt, wie man walisischen Text aus einem Bild oder PDF-Dokument liest.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Welsh
Ocr.Language = OcrLanguage.Welsh;
// Read text from the given image
using (var Input = new OcrInput(@"images\Welsh.png"))
{
// Perform OCR and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output text to the console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Welsh
Ocr.Language = OcrLanguage.Welsh;
// Read text from the given image
using (var Input = new OcrInput(@"images\Welsh.png"))
{
// Perform OCR and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output text to the console
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create an instance of IronTesseract
Dim Ocr = New IronTesseract()
' Set the language to Welsh
Ocr.Language = OcrLanguage.Welsh
' Read text from the given image
Using Input = New OcrInput("images\Welsh.png")
' Perform OCR and get the result
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
In diesem Code:
- Wir beginnen damit, den Namespace
IronOcrzu verwenden, um auf OCR-Funktionen zuzugreifen. - Wir erstellen eine Instanz von
IronTesseract, der Hauptklasse von IronOCR zur Durchführung von OCR-Operationen. - Die OCR-Sprache ist auf Walisisch eingestellt mit
Ocr.Language = OcrLanguage.Welsh. - Wir öffnen eine Bilddatei mit dem Namen
Welsh.png, die sich im Verzeichnisimagesbefindet, zur OCR-Verarbeitung. Schließlich liest die MethodeOcr.Read(Input)den Text aus dem Bild, und der extrahierte Text wird inAllTextgespeichert. - Der erkannte walisische Text wird dann auf der Konsole ausgegeben.

