ASPOSE.OCR 3.1.0 - C# Extract of text - portguese


#1

How are you doing?

Could you help me, please?

I am using the OCR version 3.1.0 dll, using the Portuguese language and it is not working, the result I am getting is quite strange.

Thank you very much.

Code that is running in C #:

protected void Send_Click(object sender, EventArgs e)
{
if(FileUploadInput.PostedFile != null)
{
try
{
string fullpath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, “files”, string.Concat(DateTime.Now.ToString(“yyyyMMddHHmmss”), Path.GetExtension(FileUploadInput.PostedFile.FileName)));
string directory = Path.GetDirectoryName(fullpath);

            if (!Directory.Exists(directory))
                Directory.CreateDirectory(directory);

            FileUploadInput.PostedFile.SaveAs(fullpath);

            // Initialize an instance of OcrEngine
            OcrEngine ocrEngine = new OcrEngine();

            // Ignore everything else on the image other than the user defined recognition blocks
            ocrEngine.Config.DetectTextRegions = true;

            // Clear notifier list
            ocrEngine.ClearNotifies();

            // set image
            ocrEngine.Image = Aspose.OCR.ImageStream.FromFile(fullpath);               

            ocrEngine.LanguageContainer.Clear();                
            ILanguage portuguese = LanguageFactory.Load(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "Languages", "Portuguese_language_resource_file_for_Aspose.OCR_for_.NET_2.3.0.zip"));
            ocrEngine.LanguageContainer.AddLanguage(portuguese);

            // do processing
            if (ocrEngine.Process())
            {
                TextBox.Text = ocrEngine.Text.ToString();
            }
            else
            {
                TextBox.Text = "Don't process";
            }
        }
        catch (Exception ex)
        {
            TextBox.Text = ex.ToString();
        }
    }
}

Image I’m using test:
modelo-de-contrato-internacional-2-638.jpg (117.9 KB)

Result of extracting the text:

elámola nxoex-a Ç criez de eleseue tzr\vc\z e c elestricc de euverce
nsmixclizc des ezv eclie de mM~rAW ceoMMVAMe de ccreuxtevic técricc e
cesesselcmertz ccoelixcl dertle de eux clec de etuctre eccremicc ecle couxertec
de meligdz/Iti rc mielIzl
oa-M-Ma hn)co ccoçveerdese çav ccriultzvxc e cesesselcmervi ccoelixcl c
elzerectre de cliertes e %/recedeves me dvillmnee fectroertz de ccrivrice de
fevrecimeMz coclicicc de elzdace e xr%Çetcz de ouclidrae celesertercz de
cozetles curtec recircicc ccozlc xr%Çetcz de melicaclice eléemtgloue e
ceelcices c ducrexlce rc emeliz/ ecle c eoMMVAMe
w Wmo
elácola seunda c eleserte tzMIK\z éceletlede ecle digilcl eelz elczz de m
XouctleX cres c expri de euc ces)rciulc ezderdc eel elzllegruz crucluerte ee fev
ccruerrerte ce expes cc tecl de oue eleccrizc c c higi egh de tzdxgz truxl
W dbR\tdRX!WO!! bella E daMolorM(IIWWE
elámola reemi-a e eoM-rAMev cens e ces)rciulc de eleserte xr%\vMmertz rcz
ezdeve de ouclouel fevoc rem ezv xr\evezetc ensecc - ezr eerc de vesecruel ezv
derci movcx% metevicie eferdcoerte mellidas e IMcIze cessertes - vezc%%cv
xr~zvmc tzes scrie fevrecedeves decumertzi feldevi cciclegis c mestle e ccrictes
ccoelixers elides dideze tos mbos ec cligrrevize des ccrictes de murmenW e
de tuc c eeu ezv-cliz de fevrecedeves rc mieliz/ tudz rc ccrocluxdcde de oue
eleccrizc c chigi Euz de tzdxgz truxl
elácula mana ce eclies ccruercicrem ezr ci eerce de Iex oue elzerciclec ume c
cutle tzdze ce esfevize ccours cco c crietruz eseecificc ecle c ccreecurcz de
eleserte mrtletc rem ccoz ccriederdc ume c cutle elerc II\vdcde de ctuctre
desde oue dertle des escres tevoce e II=x\e% de eleserte cnric


#2

@tiago.silva,

You are using quite an old version of Aspose.OCR fo r.NET. Please try it with the latest version of Aspose.OCR for .NET and let us know your feedback.


#3

@kashif.iqbal ,

The license I have allows me to only use this version of the product.
Can you provide a license for the latest product?


#4

@tiago.silva,

Although you can apply for a 30 days temporary license but we will investigate your sample image further and update you if upgrading to latest version will help you.


#5

@muhammad.ijaz,

It will be of great help if you test on the newer version and let me know if it works.

Meanwhile I will talk to my superiors about the latest version.

Thanks a lot for the help.


#6

@tiago.silva,

Sure, we are working on this and will update you shortly.


#7

@tiago.silva,

Although latest version of Aspose.OCR for .NET will produce similar results for your attached image but we recommend using Aspose.OCR for Cloud to get best results because Aspose.OCR for Cloud is being developed on a fast pace and you will get more new features and get your issues (if any) fixed more quickly.

Please check OCR_Result.zip (1.1 KB) for your reference - it contains the text extracted from your attached image using Aspose.OCR for Cloud and let us know if you want to use Aspose.OCR for .NET in any case.