OCR Issue

Hello,

I’ve bought Aspose total Net license last week for parsing documents library.

Everything works fine so far (doc, xl, pdf) except for OCR.

Could you check my code and error message please?

Regards, Vadim.

Error log Extract:

13-03-05 09:51:33.0 : Error occurred during recognition.
13-03-05 09:51:33.0 : Error while loading 0 net (Network_12netsFS_Arial_BigAlphabet_18x18_8pt_468-26_v4L): Unable to find assembly 'Aspose.OCR, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

The code:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Aspose.OCR;

using System.IO;

public static string ParseFile(string fileName, byte[] buffer)

{

    string fileExt = fileName.Substring(fileName.LastIndexOf('.') + 1).ToLower();

    ImageStreamFormat format = ImageStreamFormat.Png;

    const string resourceFileName = @"D:\Aspose\Aspose.OCR for .NET\Resource\Aspose.OCR.Resources.zip";

    Aspose.OCR.OcrEngine ocr = new Aspose.OCR.OcrEngine();

    ocr.Languages.AddLanguage(Language.Load("english"));

    ocr.Config.NeedRotationCorrection = false;

    ocr.Config.UseDefaultDictionaries = true;

    System.IO.MemoryStream stream = new MemoryStream(buffer);

    ocr.Image = ImageStream.FromMemoryStream(stream, format);

    if (!File.Exists(resourceFileName))

        return resourceFileName + " not found";

    using (ocr.Resource = new FileStream(resourceFileName, FileMode.Open))

    {

        try

        {

            if (ocr.Process())

            {

                return ocr.Text.ToString();

            }

        }

        catch (Exception ex)

        {

            addLog(ex.Message);

            addLog(ex.InnerException.Message);

            return ex.Message;

        }

    }

    return "";

}

After some debugging I found that it works if resource file and aspose.ocr.dll are in the same folder.
I tried to extract text from png document scan and after ~ 10 minutes get some garbage as extracted text:

nmnnd0scl7suw ls an I!nurfra4 !r<!m oX rAd* A/wvwm

The question is: If Aspose.OCR supposed to process png files?

Hi Nathan,


Thanks for your inquiry. Aspose.OCR supports PNG along with other image formats
(JPEG, TIF, BMP and GIF) with English, Spanish and Russian languages. It
currently supports Arial, Times New Roman and Tohama fonts. Recognition
accuracy of big font sizes i.e. 32pts and above is 90% and smaller font sizes
have less accuracy.

Please feel free to contact us for any further assistance.

Best Regards

Same issue here

How do I attach a screenshot. The OCR is terrible and unusable. Who can I contact with samples?

@jon_elster_i3intel_com

You can attach the file using upload button in the post editor while replying in the thread.

Any updates?

@jon_elster_i3intel_com

We have responded to your other similar inquiry.