We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exeption Error occurred during recognition

Hi, i’m trying to use OCR module but get on OCR Exeption (Error occurred during recognition.)
i used one example found in yours webpages… this is my code:

public void testOCR(MemoryStream _oInputStream)
{


Aspose.OCR.OcrEngine ocr = new Aspose.OCR.OcrEngine();
ocr.Image = Aspose.OCR.ImageStream.FromMemoryStream(_oInputStream, Aspose.OCR.ImageStreamFormat.Png);

ocr.Languages.AddLanguage(Aspose.OCR.Language.Load(“english”));

using (ocr.Resource = new FileStream(“P:/mytestsolution/NewFolder1/Aspose.OCR.1.9.0.Resources.zip”, FileMode.Open))
{
try
{
// Process the whole image
if (ocr.Process())
{
Console.WriteLine(“Whole Text :” + ocr.Text);
//Retrieve an array of recognized text by parts
Aspose.OCR.IRecognizedTextPartInfo[] text = ocr.Text.PartsInfo;
//Iterate over the text parts
foreach (Aspose.OCR.IRecognizedTextPartInfo symbol in text)
{
//Display the part information
Console.WriteLine(“Symbol:” + symbol.Text);
//Get the rectangle sourronding the symbol
System.Drawing.Rectangle box = symbol.Box;
//Display the rectangle location on the image canvas
Console.WriteLine(“Box Location:” + box.Location);
//Display the rectangle dimensions
Console.WriteLine(“Box Size:” + box.Size);

}
}
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}
}

}

when code executes “(ocr.Process())” it runs in exeption
resource file seems to be well placed…so what’s the problem?
thank’s

Hi,


Thank you for using Aspose products.

Unfortunately, we are unable to replicate your presented scenario on our end while using the latest version of Aspose.OCR for .NET 1.9.0. Please confirm that you are using the latest version v1.9.0 on your side. In case you are using the latest version then please share the InnerException message and detailed stack trace along with your sample image for our review.

very strange: today it works on my pc!

reboot needed?

Ok, no more exeptions but it finds only 6 symbols related on the text “evaluation copy…” etc
is because of trial licence or is there a problem in text recognition?

Hi again,


Good to know that you are up and running again. In case you hit an exception next time, it is suggested to check the InnerException message for details, this is because the plain exception message may be generic, and may not give you an idea what has gone wrong. Although the InnerException message would be precised to the issue.

Regarding the number of characters recognized in evaluation mode, Aspose.OCR APIs allows recognition of up to 50 characters without setting a valid license. Please see the detailed article on this subject. In case you wish to evaluate the product without any limitations, we would suggest you to request for a 30 day temporary license to test the product at it’s full capacity.