Vietnamese 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# pozwalający programistom .NET na odczyt tekstu z obrazów i dokumentów PDF w 126 językach, w tym wietnamskim.

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.Vietnamese

Ten pakiet zawiera 132 języki OCR dla .NET:

  • Wietnamski
  • WietnamskiNajlepszy
  • WietnamskiSzybki
  • WietnamskiAlfabet
  • WietnamskiAlfabetNajlepszy
  • WietnamskiAlfabetSzybki

Pobieranie

Vietnamese Language Pack [Tiếng Việt]

Instalacja

Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie pakietu OCR wietnamskiego do Twojego projektu .NET.

Install-Package IronOcr.Languages.Vietnamese

Przyklad kodu

Ten przykład kodu C# odczytuje tekst wietnamski z obrazu lub dokumentu PDF.

// You need to install the IronOcr.Languages.Vietnamese package using the following NuGet command before running this code:
// PM> Install-Package IronOcr.Languages.Vietnamese

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese;

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

    // Extract all recognized text
    var AllText = Result.Text;

    // Example: Output the extracted text to the console
    Console.WriteLine(AllText);
}
// You need to install the IronOcr.Languages.Vietnamese package using the following NuGet command before running this code:
// PM> Install-Package IronOcr.Languages.Vietnamese

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese;

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

    // Extract all recognized text
    var AllText = Result.Text;

    // Example: Output the extracted text to the console
    Console.WriteLine(AllText);
}
' You need to install the IronOcr.Languages.Vietnamese package using the following NuGet command before running this code:
' PM> Install-Package IronOcr.Languages.Vietnamese

Imports IronOcr

Dim Ocr As New IronTesseract()

' Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese

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

    ' Extract all recognized text
    Dim AllText = Result.Text

    ' Example: Output the extracted text to the console
    Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

W tym przykładzie kodu:

  • Tworzymy instancję IronTesseract.
  • Ustawiamy język na wietnamski za pomocą Ocr.Language = OcrLanguage.Vietnamese;.
  • Tworzymy obiekt OcrInput z ścieżką do obrazu lub PDF.
  • Wywołujemy metodę Read, aby wykonać OCR i uzyskać wyodrębniony tekst.
  • Wyodrębniony tekst jest przechowywany w AllText, który można używać wedle potrzeby, na przykład wyświetlając go lub zapisując do pliku.