recognize error

Apr 1, 2010 at 11:27 AM

Hi, Maxim

I get "Recognition Engine Halted with Error Code:0" error when i press recognize button in sample application.

Also this error i get in this code:

 

Bitmap image = new Bitmap(pictureBox1.Image);//Image load to picturebox first
            try
            {
                var pumaPage = new PumaPage(image);
                using (pumaPage)
                {
                    pumaPage.FileFormat = PumaFileFormat.RtfAnsi;
                    pumaPage.EnableSpeller = false;
                    pumaPage.Language = PumaLanguage.Russian;
                    pumaPage.RecognizeToFile("D:\\page001.rtf");
                }
            }
            catch(Exception exc) 
            {
                MessageBox.Show(exc.Message);
            }

 

 

I try to load different images, but same error all time.

Image: http://img97.imageshack.us/img97/9633/51648785.png,

OS - Windows 7, VS 2008.

What kind of problems can be? Maybe i install something wrong, or Puma.NET doesn't work on windows 7?

Thank for you help.

Best regards, Sergey

Coordinator
Apr 3, 2010 at 6:15 PM

Dear Sergey,

I'm confused with the error since it works for me. I've tried sample application and the image you've provided (in Windows 7). What I actually can advice you is to try this build PumaNET(x86).msi, it's more late. For now it's hard for me to say waht's wrong.

Regards, Maxim.

Apr 11, 2010 at 9:47 AM

Hi Maxim,

 

I've the same problem. I installed PumaNET.msi on machine 32 bit. I opened the sample project with VS2008, I update the reference Puma.Net and run the application. The application is run correctly, I selected a bmp file, and pressed Recognize button, then the application crash with follow message exception:

"An unhandled exception of type 'Puma.Net.RecognitionEngineException' occurred in Puma.Net.dll. 

Additional information: Recognition engine halted with code:0"

 

Any idea ?

An unhandled exception of type 'Puma.Net.RecognitionEngineException' occurred in Puma.Net.dll
Additional information: Recognition engine halted with code:0An unhandled exception of type 'Puma.Net.RecognitionEngineException' occurred in Puma.Net.dll
Additional information: Recognition engine halted with code:0

 

Apr 19, 2011 at 4:15 PM

Maxim,

I have been testing out your program for reading text from multimedia (like webpages).

I got that exception and error code '0' a few times too, but I think it depends on the image. When I try images with small font (less than about 12pt) or a background that's darker than the text, I get the exception. Otherwise, it works okay.

May 2, 2011 at 5:38 PM

I fixed my own problem, anyway. If anyone's interested in seeing it:

try
{
    Console.WriteLine("Recognized text: \n{0}", PumaImage.RecognizeToString());
}
// if OCR fails, an exception is thrown
catch
{ try { // invert colors and try again // text must be darker than background for successful OCR Bitmap InvertedImage = new Bitmap(Image.Width, Image.Height); for (int y = 0; y < Image.Height; y++) for (int x = 0; x < Image.Width; x++) { Color CurrentColor = Image.GetPixel(x, y); InvertedImage.SetPixel(x, y, Color.FromArgb( CurrentColor.R ^ 0xFF, CurrentColor.G ^ 0xFF, CurrentColor.B ^ 0xFF)); } PumaImage.Bitmap = InvertedImage; Console.WriteLine("Recognized text: \n{0}", PumaImage.RecognizeToString()); } catch { Console.WriteLine("recognition failed"); } }

Dec 6, 2013 at 6:23 AM
Hi,
Is this code compatible with window -8 also, because i am facing error