Ukrainian OCR in C# and .NET
Inne wersje tego dokumentu:
IronOCR to komponent oprogramowania C#, który pozwala programistom .NET na odczyt tekstu z obrazów i dokumentów PDF w 126 językach, w tym po ukraińsku.
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.Ukrainian
Pakiet ten zawiera 52 języki OCR dla .NET:
- Ukraiński
- UkrainianBest
- UkrainianFast
Pobieranie
Ukrainian Language Pack [українська мова]
Instalacja
Pierwszą rzeczą, którą należy zrobić, to zainstalować pakiet OCR Ukrainian w swoim projekcie .NET.
Install-Package IronOcr.Languages.Ukrainian
Przyklad kodu
Ten przykład kodu C# odczytuje tekst ukraiński z obrazu lub dokumentu PDF.
// Ensure you have the IronOcr.Languages.Ukrainian package installed.
// Using IronOcr namespace to access OCR functionalities.
using IronOcr;
// Initialize a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the OCR language to Ukrainian
Ocr.Language = OcrLanguage.Ukrainian;
// Use an OcrInput object for image input
using (var Input = new OcrInput(@"images\Ukrainian.png"))
{
// Perform OCR operation on the image
var Result = Ocr.Read(Input);
// Get the extracted text from the result
var AllText = Result.Text;
// Output or use the extracted text as needed
Console.WriteLine(AllText);
}
// Ensure you have the IronOcr.Languages.Ukrainian package installed.
// Using IronOcr namespace to access OCR functionalities.
using IronOcr;
// Initialize a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the OCR language to Ukrainian
Ocr.Language = OcrLanguage.Ukrainian;
// Use an OcrInput object for image input
using (var Input = new OcrInput(@"images\Ukrainian.png"))
{
// Perform OCR operation on the image
var Result = Ocr.Read(Input);
// Get the extracted text from the result
var AllText = Result.Text;
// Output or use the extracted text as needed
Console.WriteLine(AllText);
}
Imports IronOcr
' Initialize a new instance of IronTesseract
Dim Ocr As New IronTesseract()
' Set the OCR language to Ukrainian
Ocr.Language = OcrLanguage.Ukrainian
' Use an OcrInput object for image input
Using Input As New OcrInput("images\Ukrainian.png")
' Perform OCR operation on the image
Dim Result = Ocr.Read(Input)
' Get the extracted text from the result
Dim AllText = Result.Text
' Output or use the extracted text as needed
Console.WriteLine(AllText)
End Using
- Upewnij się, że zastępujesz ścieżkę
"images\Ukrainian.png"ścieżką do własnego obrazu lub dokumentu PDF. - Ten przykład demonstruje skonfigurowanie IronOCR do rozpoznawania tekstu ukraińskiego i wyprowadzania wyodrębnionego tekstu.

