Praca z cyframi arabskimi w IronOCR
Czy pakiety językowe dla języka arabskiego, perskiego i urdu nie rozpoznają cyfr arabskich?
Jest to znany problem z pakietami językowymi Tesseract.
Następujący pakiet językowy może pomóc w rozwiązaniu tego problemu z cyframi arabskimi: Shreeshrii's Tessdata Arabic
Następnie można to wykorzystać z funkcją IronOCR do ładowania niestandardowych pakietów językowych: IronOCR Przykład niestandardowego języka
using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}
using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}
Imports IronOcr
Friend Class ArabicNumeralOCR
Shared Sub Main(ByVal args() As String)
' Initialize a new instance of IronTesseract for OCR
Dim Ocr = New IronTesseract()
' Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")
' Specify the image input for OCR processing
Using Input = New OcrInput("images\image.png")
' Execute the OCR process on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text
Console.WriteLine(Result.Text)
End Using
End Sub
End Class
Uwaga: Ten przykład w C# pokazuje, jak używać niestandardowego pliku językowego Tesseract w IronOCR, aby poprawić rozpoznawanie cyfr arabskich w obrazach. Zakłada, że już pobrano odpowiedni pakiet językowy i umieszczono go w określonej lokalizacji. Upewnij się, że zainstalowano IronOCR i dodano niezbędną obsługę błędów w kodzie produkcyjnym.

