External component has thrown an exception

Skip to first unread message


Feb 13, 2023, 6:59:01 AM2/13/23
to tesseract-ocr
I'm using Tesseract 5.2.0, but I've tried 4.1.1 and 3.0.2, every time with the appropriate data files, and this problem happens every time.

I have a simple program that reads the text of a video displayed in a pictureBox. Everything functions well, but once the program has been running for 20 or so seconds, it crashes with the error message: System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'

  Message=External component has thrown an exception.
  Source=<Cannot evaluate the exception source>
<Cannot evaluate the exception stack trace>

I have this timer with the following code inside:

private void timer1_Tick(object sender, EventArgs e)
            img = capturearea(pic);
            TesseractEngine engine = new TesseractEngine("./tessdata", "eng", EngineMode.TesseractOnly);
            Page page = engine.Process(img, PageSegMode.Auto);
            textBox1.Text = page.GetText();

The TesseractEngine line is the one throwing the error. I've tried every Engine Mode in all the versions I mentioned but the same thing happens. What could be going wrong? It feels like a RAM issue, but it happens on another PC too and they're both powerful machines.


Feb 13, 2023, 7:01:02 AM2/13/23
to tesseract-ocr
My bad, I meant to post on the account I reposted from.
Reply all
Reply to author
0 new messages