Western Frisian 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 w C#, pozwalający programistom .NET odczytywać tekst z obrazów i dokumentów PDF w 126 językach, w tym w języku Western Frisian.

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

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

  • WesternFrisian
  • WesternFrisianBest
  • WesternFrisianFast

Pobieranie

Pakiet językowy Western Frisian [Frysk]

  • Pobierz jako Zip
  • Zainstaluj przez NuGet

Instalacja

Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie naszego pakietu OCR Western Frisian do twojego projektu .NET.

Install-Package IronOcr.Languages.WesternFrisian

Przyklad kodu

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

// Import the IronOcr library
using IronOcr;

class WesternFrisianOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract, which is the OCR engine 
        var Ocr = new IronTesseract();

        // Set the language to Western Frisian
        Ocr.Language = OcrLanguage.WesternFrisian;

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

            // Extract the text from the result
            string AllText = Result.Text;

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr library
using IronOcr;

class WesternFrisianOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract, which is the OCR engine 
        var Ocr = new IronTesseract();

        // Set the language to Western Frisian
        Ocr.Language = OcrLanguage.WesternFrisian;

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

            // Extract the text from the result
            string AllText = Result.Text;

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr library
Imports IronOcr

Friend Class WesternFrisianOcrExample
	Shared Sub Main()
		' Create a new instance of IronTesseract, which is the OCR engine 
		Dim Ocr = New IronTesseract()

		' Set the language to Western Frisian
		Ocr.Language = OcrLanguage.WesternFrisian

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

			' Extract the text from the result
			Dim AllText As String = Result.Text

			' Output the recognized text to the console
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

W tym przykładzie, my:

  • Inicjalizujemy silnik OCR IronTesseract.
  • Ustawiamy proces OCR na rozpoznawanie tekstu w języku Western Frisian, używając opcji językowej OcrLanguage.WesternFrisian.
  • Odczytujemy plik obrazu znajdujący się na ścieżce images\WesternFrisian.png.
  • Przechowujemy rozpoznany tekst w AllText i wyświetlamy go w konsoli.