Hindi 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 odczytywać tekst z obrazów i dokumentów PDF w 126 językach, w tym w hindi.

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

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

  • Hindi
  • HindiBest
  • HindiFast

Pobieranie

Hindi Language Pack [हिनदी]

Instalacja

Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie naszego pakietu OCR Hindi w projekcie .NET.

Install-Package IronOcr.Languages.Hindi

Przyklad kodu

Ten przykład kodu C# odczytuje tekst w języku hindi z obrazu lub dokumentu PDF.

// Make sure to install IronOcr.Languages.Hindi package before running the code
using IronOcr;

var Ocr = new IronTesseract(); // Create a new instance of the OCR engine
Ocr.Language = OcrLanguage.Hindi; // Set the language to Hindi

// Load the image file containing Hindi text
using (var Input = new OcrInput(@"images\Hindi.png"))
{
    // Perform OCR on the image
    var Result = Ocr.Read(Input);

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

    // Optionally, you can print the extracted text
    Console.WriteLine(AllText);
}
// Make sure to install IronOcr.Languages.Hindi package before running the code
using IronOcr;

var Ocr = new IronTesseract(); // Create a new instance of the OCR engine
Ocr.Language = OcrLanguage.Hindi; // Set the language to Hindi

// Load the image file containing Hindi text
using (var Input = new OcrInput(@"images\Hindi.png"))
{
    // Perform OCR on the image
    var Result = Ocr.Read(Input);

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

    // Optionally, you can print the extracted text
    Console.WriteLine(AllText);
}
' Make sure to install IronOcr.Languages.Hindi package before running the code
Imports IronOcr

Private Ocr = New IronTesseract() ' Create a new instance of the OCR engine
Ocr.Language = OcrLanguage.Hindi ' Set the language to Hindi

' Load the image file containing Hindi text
Using Input = New OcrInput("images\Hindi.png")
	' Perform OCR on the image
	Dim Result = Ocr.Read(Input)

	' Extract the recognized text
	Dim AllText = Result.Text

	' Optionally, you can print the extracted text
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Uwaga: Upewnij się, że ścieżka do Hindi.png jest prawidłowa i zainstalowane są niezbędne pakiety.