Divehi OCR in C# and .NET
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 w Divehi.
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.Divehi
Ten pakiet zawiera 43 języki OCR dla .NET:
- Divehi
- DivehiBest
- DivehiFast
Pobieranie
Divehi Language Pack [ދވހ]
Instalacja
Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie pakietu OCR Divehi do twojego projektu .NET.
Install-Package IronOcr.Languages.Divehi
Przyklad kodu
Ten przykład kodu C# odczytuje tekst Divehi z obrazu lub dokumentu PDF.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi;
// Load the image or PDF document into the OCR processor
using (var Input = new OcrInput(@"images\Divehi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi;
// Load the image or PDF document into the OCR processor
using (var Input = new OcrInput(@"images\Divehi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create an instance of the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi
' Load the image or PDF document into the OCR processor
Using Input = New OcrInput("images\Divehi.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Wyjaśnienie
- Importowanie IronOcr: Przykład rozpoczyna się od importowania niezbędnej przestrzeni nazw IronOcr.
- Tworzenie silnika OCR: Tworzona jest instancja
IronTesseract, silnika OCR. - Określenie języka: Język dla przetwarzania OCR jest ustawiony na Divehi, zapewniając dokładne rozpoznanie dostosowane do tego języka.
- Ładowanie danych wejściowych: Obraz lub dokument PDF jest otwierany przy użyciu
OcrInput, gotowy do ekstrakcji tekstu. - Wykonywanie OCR: Metoda
Readprzetwarza dane wejściowe i ekstrakuje tekst. - Ekstrakcja tekstu: Rozpoznany tekst jest przechowywany w
AllTexti drukowany na konsolę.
Ten kod pokazuje prosty, ale potężny sposób na wykorzystanie IronOCR do odczytywania pisma Divehi z dokumentów cyfrowych.

