Cherokee OCR in C

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#, który pozwala programistom .NET odczytywać tekst z obrazów i dokumentów PDF w 126 językach, w tym cherokee.

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

Ta paczka zawiera 120 języków OCR dla .NET:

  • CherokeeAlphabet
  • CherokeeAlphabetBest
  • CherokeeAlphabetFast
  • Cherokee
  • CherokeeBest
  • CherokeeFast

Pobieranie

Cherokee Language Pack [ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ]

Instalacja

Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie naszej paczki Cherokee OCR do projektu .NET.

Install-Package IronOcr.Languages.Cherokee

Przyklad kodu

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

// Import the IronOcr namespace
using IronOcr;

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

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

        // Use OcrInput to specify the image or PDF to be read
        using (var Input = new OcrInput(@"images\Cherokee.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

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

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

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

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

        // Use OcrInput to specify the image or PDF to be read
        using (var Input = new OcrInput(@"images\Cherokee.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

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

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

Friend Class Program
	Shared Sub Main()
		' Create an instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

		' Set the language for OCR to Cherokee
		Ocr.Language = OcrLanguage.Cherokee

		' Use OcrInput to specify the image or PDF to be read
		Using Input = New OcrInput("images\Cherokee.png")
			' Perform OCR on the input document
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

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

Oto krótki opis działania kodu:

  • IronTesseract: Tworzona jest instancja klasy IronTesseract do obsługi operacji OCR.
  • OcrLanguage.Cherokee: Ustawienie języka na cherokee za pomocą właściwości OcrLanguage.Cherokee, co informuje silnik OCR, że ma rozpoznawać tekst w języku cherokee.
  • OcrInput: Podana jest ścieżka wejściowa do klasy OcrInput, gdzie znajduje się obraz lub dokument PDF.
  • Ocr.Read: Wywoływana jest metoda Read na obiekcie OCR z przekazaną ścieżką wejściową. Wykonuje proces OCR.
  • Result.Text: Wydobywa rozpoznany tekst z wyniku i zapisuje go w zmiennej AllText do dalszego wykorzystania.
  • Wyjście konsoli: Rozpoznany tekst jest drukowany na konsolę.