Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime exception #9

Open
hypertunes opened this issue Jul 28, 2012 · 1 comment
Open

Runtime exception #9

hypertunes opened this issue Jul 28, 2012 · 1 comment

Comments

@hypertunes
Copy link

I am trying to integrate the tesseract ocr in my C'# application. I have included the libtesseract.dll in my application as a reference and during the tesseract initialization it throws a runtime exception saying

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

I am using the same code example that has been given by on this page

                    using (var bmp = numberplate)
                    {
                        var success = processor.Init(@"E:\Roshan Rajaratnam\Desktop\tesseract-ocr-3.01.eng (1)\tesseract-ocr\tessdata\", language, (int)eOcrEngineMode.OEM_DEFAULT);
                        if (!success)
                        {
                            Console.WriteLine("Failed to initialize tesseract.");
                        }
                        else
                        {
                            string text = processor.Recognize(bmp);
                            Console.WriteLine("Text:");
                            Console.WriteLine("*****************************");
                            Console.WriteLine(text);
                            Console.WriteLine("*****************************");
                        }
                    }

what can be the cause for this?

@charlesw
Copy link
Owner

charlesw commented Aug 2, 2012

The most common causes are that the app is running as a 64 bit process or the tesseract data directory isn't correct (you must use language definitions compiled for version 3.02 of tesseract-ocr).

Hope that helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants