Error when press recognize button.

Jan 23, 2010 at 9:51 PM

Hello,

 

I have tried using the sample but every time I load an image I get the folling error when I press the Recognize button.

 

I have tired this running under VS2008 and VS2010

 

Recognition engine halted with code:0

 

at Puma.Net.PumaPage.RecognizeToFile(String fileName, PumaFileFormat format)
   at Puma.Net.PumaPage.RecognizeToFile(String fileName)
   at Puma.Net.Sample.MainForm.recognizeButton_Click(Object sender, EventArgs e) in C:\Program Files\Puma.NET\Sample\Backup\MainForm.cs:line 94
   at Puma.Net.Sample.ImageViewer.recognizeButton_Click(Object sender, EventArgs e) in C:\Program Files\Puma.NET\Sample\Backup\ImageViewer.cs:line 217
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Puma.Net.Sample.Program.Main() in C:\Program Files\Puma.NET\Sample\Backup\Program.cs:line 41
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Coordinator
Jan 25, 2010 at 6:58 AM

Hello,

Could you please provide me with image samples and recognition settings.

 

Jan 25, 2010 at 10:15 AM

This is the code that I tried that produced the error.

private void button1_Click(object sender, EventArgs e)
        {
            Bitmap b = new Bitmap(100, 20);
            Graphics g = Graphics.FromImage(b);
            g.FillRectangle(Brushes.White, 0,0,100, 100);
            g.DrawString("My Text", new Font("Arial", 8), Brushes.Black, new PointF(1, 1));
            BackgroundImage = (Bitmap)b.Clone();
            BackgroundImageLayout = ImageLayout.None;
            PumaPage pumaPage = new PumaPage(b);
            using (pumaPage)
            {
                pumaPage.FileFormat = PumaFileFormat.RtfAnsi;
                pumaPage.EnableSpeller = false;
                pumaPage.Language = PumaLanguage.English;
                string a = pumaPage.RecognizeToString();
            }

        }

 

Also tired to use the following image.

http://img33.imageshack.us/img33/7681/thistest.jpg

code

private void button2_Click(object sender, EventArgs e)
        {
            PumaPage pumaPage = new PumaPage("c:\\temp\\ThisTest.jpg");
            using (pumaPage)
            {
                pumaPage.FileFormat = PumaFileFormat.RtfAnsi;
                pumaPage.EnableSpeller = false;
                pumaPage.Language = PumaLanguage.English;
                string a = pumaPage.RecognizeToString();
            }
        }

 

Thank you for your help

Coordinator
Jan 25, 2010 at 10:31 AM

The characters at image are to small, recognition engine is optimized for scanned images thus it expects large symbols, at least 40 pix high.

Jan 25, 2010 at 10:56 AM

OK thank you for your reply.

 

Guess I will look for a different engine.

Mar 28, 2011 at 2:08 PM

Hello, 


I have the same problem, and I would like to know, How it's possible to avoid this exception. 

In other word, if the image send to recognize haven't character how can i avoid the fatal error.

 

Thank you