Portuguese OCR in C# and .NET
Inne wersje tego dokumentu:
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 portugalskim.
Jest to zaawansowany fork Tesseract, stworzony wyłącznie dla programistów .NET i regularnie przewyższa inne silniki Tesseract zarówno pod względem szybkości, jak i dokładności.
Zawartość IronOcr.Languages.Portuguese
Ten pakiet zawiera 55 języków OCR dla .NET:
- Portugalski
- PortugueseBest
- PortugueseFast
Pobieranie
Portuguese Language Pack [português]
Instalacja
Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie naszego pakietu OCR Portuguese do twojego projektu .NET.
Install-Package IronOcr.Languages.Portuguese
Przyklad kodu
Ten przykład kodu C# odczytuje tekst portugalski z obrazu lub dokumentu PDF.
// Required using directive for IronOcr
using IronOcr;
var Ocr = new IronTesseract();
// Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese;
// Load the image or PDF from which to read the text
using (var Input = new OcrInput(@"images\Portuguese.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the extracted text
Console.WriteLine(AllText);
}
// Required using directive for IronOcr
using IronOcr;
var Ocr = new IronTesseract();
// Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese;
// Load the image or PDF from which to read the text
using (var Input = new OcrInput(@"images\Portuguese.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the extracted text
Console.WriteLine(AllText);
}
' Required using directive for IronOcr
Imports IronOcr
Private Ocr = New IronTesseract()
' Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese
' Load the image or PDF from which to read the text
Using Input = New OcrInput("images\Portuguese.png")
' Perform OCR on the input
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text
Dim AllText = Result.Text
' Output the extracted text
Console.WriteLine(AllText)
End Using
Ten kod demonstruje, jak skonfigurować i używać biblioteki IronOCR do odczytu tekstu portugalskiego z obrazu. Upewnij się, że ścieżka do obrazu lub dokumentu PDF jest poprawna. Rozpoznany tekst będzie przechowywany w zmiennej AllText i zostanie wydrukowany na konsoli.

