Error occurred during recognition

hello,

Can someone help me to solve this error :

OcrEngine ocrEngine = new OcrEngine();
ocrEngine.Image=ImageStream.FromFile(“C:\OCRTest\image1.jpg”);
ocrEngine.LanguageContainer.Clear(); ocrEngine.LanguageContainer.AddLanguage(LanguageFactory.Load(“C:\OCRTest\Aspose.OCR.French.Resources.zip”));
if (ocrEngine.Process()) ==> Error occurred during recognition
{
string resultat= ocrEngine.Text.ToString();
}

Thank you,
AtefVenturis

Hi AtefVenturis.


Thank you for considering Aspose APIs.

Please share the sample image (image1.jpg) along with the complete stack trace so we could thoroughly investigate the said problem on our side to assist you further in this regard.

Hello Babar Raza,


I attached you the image.
Can you try to read the text on the image below with Aspose.ocr ?
I think that the code that i puted in my last message is correct beacause it worked with another image but it dosen’t work with others.

Sincerly yours.

AtefVenturis
Hi AtefVenturis,

Thank you for providing us the image file,

We have performed testing on the image provided by you at our end. It was found that the given code is working fine and producing results. We have used the latest version of Aspose.OCR for .NET 2.6.0 and a valid license file in order to conduct the testing. Following is the complete code snippet that worked:

var _lic = new Aspose.OCR.License();
_lic.SetLicense(@"C:\Aspose.Total.lic");

OcrEngine ocrEngine = new OcrEngine();
ocrEngine.Image = ImageStream.FromFile(@"C:\ocr_files\image1.jpg");
ocrEngine.LanguageContainer.Clear();
ocrEngine.LanguageContainer.AddLanguage(LanguageFactory.Load(@"C:\ocr_files\Aspose.OCR.French.Resources.zip"));

if (ocrEngine.Process())
{
Console.WriteLine(ocrEngine.Text);
}

Please, try again using above mentioned information. In case you have any queries, please be sure to let us know, we will be glad to assist you.


Yes i’am using the last version with a valid license.
The problem was solved with this code:

OcrEngine ocrEngine = new OcrEngine();

ocrEngine.ClearNotifies();

ocrEngine.Config.ClearRecognitionBlocks();

ocrEngine.Config.DetectTextRegions = false;

ocrEngine.Image = ImageStream.FromFile(@"C:\ocr_files\image1.jpg");

if (ocrEngine.Process())
{
Console.WriteLine(ocrEngine.Text);
}

AtefVenturis,

Hi,


It is good to know that you are able to avoid the said problem. Please feel free to contact us back in case you need our further assistance with Aspose APIs.