Trabajar con números arábigos en IronOCR
¿Los paquetes de idiomas árabe, persa y urdu no reconocen los números arábigos?
Este es un problema conocido con los paquetes de idiomas de Tesseract.
El siguiente paquete de idioma puede ayudar a abordar este problema con los números arábigos: Tessdata Árabe de Shreeshrii
Esto luego se puede utilizar con la función de IronOCR para cargar paquetes de idiomas personalizados: Ejemplo de Lenguaje Personalizado de IronOCR
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 ClassNota: Este ejemplo en C# demuestra cómo usar un archivo de idioma Tesseract personalizado en IronOCR para mejorar el reconocimiento de números arábigos dentro de imágenes. Se supone que ya has descargado el paquete de idioma apropiado y lo has colocado en la ubicación especificada. Asegúrate de instalar IronOCR y agregar el manejo de errores necesario en el código de producción.






