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

Jest to zaawansowany fork Tesseract, zbudowany wyłącznie dla deweloperów .NET, który regularnie przewyższa inne silniki Tesseract zarówno pod względem szybkości, jak i dokładności.

Zawartość IronOcr.Languages.Bosnian

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

  • Bosniacki
  • BosnianBest
  • BosnianFast

Pobieranie

Bosnian Language Pack [bosanski jezik]

Instalacja

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

Install-Package IronOcr.Languages.Bosnian

Przyklad kodu

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

// Ensure the IronOCR library is included
using IronOcr;

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

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

        // Use OcrInput to specify the input file path for OCR
        using (var Input = new OcrInput(@"images\Bosnian.png"))
        {
            // Perform OCR on the input image or PDF
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Ensure the IronOCR library is included
using IronOcr;

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

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

        // Use OcrInput to specify the input file path for OCR
        using (var Input = new OcrInput(@"images\Bosnian.png"))
        {
            // Perform OCR on the input image or PDF
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Ensure the IronOCR library is included
Imports IronOcr

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

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

		' Use OcrInput to specify the input file path for OCR
		Using Input = New OcrInput("images\Bosnian.png")
			' Perform OCR on the input image or PDF
			Dim Result = Ocr.Read(Input)

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

			' Output the recognized text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Powyższy kod demonstruje, jak wykonać OCR na obrazie tekstu bosniackiego za pomocą IronOCR.
  • Klasa IronTesseract jest używana do konfigurowania i wykonywania zadań OCR.
  • Klasa OcrInput jest używana do określenia pliku obrazu wejściowego, z którego ma zostać wyodrębniony tekst.
  • Na koniec rozpoznany tekst jest drukowany na konsoli.