Malayalam OCR in C# and .NET

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

126 wiecej jeżyków

IronOCR to komponent oprogramowania C# pozwalający programistom .NET na odczytywanie tekstu z obrazów i dokumentów PDF w 126 językach, w tym Malayalam. Jest to zaawansowany fork Tesseract, stworzony wyłącznie dla programistów .NET i regularnie przewyższa inne silniki Tesseract zarówno pod względem szybkości, jak i dokładności.

Zawartość IronOcr.Languages.Malayalam

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

  • Malayalam
  • MalayalamBest
  • MalayalamFast
  • MalayalamAlphabet
  • MalayalamAlphabetBest
  • MalayalamAlphabetFast

Pobieranie

Malayalam Language Pack [മലയാളം]

Instalacja

Pierwszą rzeczą, jaką musimy zrobić, jest zainstalowanie pakietu Malayalam OCR do twojego projektu .NET.

Install-Package IronOcr.Languages.Malayalam

Przyklad kodu

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

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of IronTesseract
        var Ocr = new IronTesseract();

        // Set the language to Malayalam
        Ocr.Language = OcrLanguage.Malayalam;

        // Process the image to extract text using OCR
        using (var Input = new OcrInput(@"images\Malayalam.png"))
        {
            // Read the text from the input object
            var Result = Ocr.Read(Input);

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

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of IronTesseract
        var Ocr = new IronTesseract();

        // Set the language to Malayalam
        Ocr.Language = OcrLanguage.Malayalam;

        // Process the image to extract text using OCR
        using (var Input = new OcrInput(@"images\Malayalam.png"))
        {
            // Read the text from the input object
            var Result = Ocr.Read(Input);

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

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of IronTesseract
		Dim Ocr = New IronTesseract()

		' Set the language to Malayalam
		Ocr.Language = OcrLanguage.Malayalam

		' Process the image to extract text using OCR
		Using Input = New OcrInput("images\Malayalam.png")
			' Read the text from the input object
			Dim Result = Ocr.Read(Input)

			' Extract and store the recognized text
			Dim AllText = Result.Text

			' Output the recognized text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Kod pokazuje, jak skonfigurować IronOCR do wykonywania OCR na określonym obrazie z użyciem języka Malayalam.
  • Obiekt OcrInput jest używany do wprowadzenia pliku obrazu.
  • Funkcja Ocr.Read przetwarza obraz i wyodrębnia tekst.
  • Wyodrębniony tekst jest przechowywany w AllText i drukowany na konsoli.