I have a program in C# that reads the text of a video displayed in a pictureBox. Currently using Tesseract 5.2.0, but I've tried 4.1.1 and 3.0.2 always with the appropriate data files, and this has happened every time.
I have this code running in a timer:
img = capturearea(pic);
TesseractEngine engine = new TesseractEngine("./tessdata", "eng", EngineMode.TesseractOnly);
Page page = engine.Process(img, PageSegMode.Auto);
textBox1.Text = page.GetText();
Everything works well, but once the program has been running for 20 seconds or so, the TesseractEngine line throws an error System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'
System.Runtime.InteropServices.SEHException
HResult=0x80004005
Message=External component has thrown an exception.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
I've tried every Engine Mode in every version of Tesseract that I've tried. It feels like a RAM issue, but it also happens on another PC, and they're both powerful machines. What could be going wrong?