Romanian OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Inne wersje tego dokumentu:

IronOCR to komponent oprogramowania C# umożliwiający programistom .NET odczyt tekstu z obrazów i dokumentów PDF w 126 językach, w tym w rumuńskim. Jest to zaawansowany fork Tesseracta, zbudowany wyłącznie dla deweloperów .NET i regularnie przewyższający inne silniki Tesseract pod względem szybkości i dokładności.

Zawartość IronOcr.Languages.Romanian

Ten pakiet zawiera 49 języków OCR dla .NET:

  • Romanian
  • RomanianBest
  • RomanianFast

Pobieranie

Romanian Language Pack [limba română]

Instalacja

Pierwszą rzeczą, którą musimy zrobić, to zainstalować nasz pakiet Romanian OCR w projekcie .NET.

Install-Package IronOcr.Languages.Romanian

Przyklad kodu

Ten przykład kodu C# odczytuje tekst po rumuńsku z obrazu lub dokumentu PDF.

// Ensure you have installed the Romanian OCR package using the following NuGet command:
// PM> Install-Package IronOcr.Languages.Romanian

using IronOcr;

var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Romanian;

using (var Input = new OcrInput(@"images\Romanian.png")) 
{
    // Perform OCR on the input image, and store the result
    var Result = Ocr.Read(Input);

    // Extract all recognized text from the OCR result
    var AllText = Result.Text;

    // Display the recognized text
    Console.WriteLine(AllText);
}
// Ensure you have installed the Romanian OCR package using the following NuGet command:
// PM> Install-Package IronOcr.Languages.Romanian

using IronOcr;

var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Romanian;

using (var Input = new OcrInput(@"images\Romanian.png")) 
{
    // Perform OCR on the input image, and store the result
    var Result = Ocr.Read(Input);

    // Extract all recognized text from the OCR result
    var AllText = Result.Text;

    // Display the recognized text
    Console.WriteLine(AllText);
}
Imports IronOcr

' Ensure you have installed the Romanian OCR package using the following NuGet command:
' PM> Install-Package IronOcr.Languages.Romanian

Dim Ocr As New IronTesseract()
Ocr.Language = OcrLanguage.Romanian

Using Input As New OcrInput("images\Romanian.png")
    ' Perform OCR on the input image, and store the result
    Dim Result = Ocr.Read(Input)

    ' Extract all recognized text from the OCR result
    Dim AllText = Result.Text

    ' Display the recognized text
    Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Powyższy kod pokazuje, jak skonfigurować IronOCR do odczytu tekstu w języku rumuńskim z pliku graficznego. IronTesseract() inicjuje nową instancję silnika OCR, a OcrInput() ładuje obraz do przetwarzania. Metoda Read() wykonuje operację OCR. Na koniec, rozpoznany tekst jest przechowywany w zmiennej AllText, która następnie jest drukowana na konsolę. Pamiętaj, aby zastąpić "images\Romanian.png" ścieżką do pliku graficznego.