Question

This is getting more and more strange.

I was having problems with getting MODI engine to recognize text in an image (OCR) in C#. It always failed with a clueless msg (SEHException (0x80004005): External component has thrown an exception). I digged it over the Internet and SO and found different suggestions including changing image format from BMP to TIFF, resizing image to have a size that is a power of 2 and some others, none of which worked. Interestingly, even the Office Imaging application was unable to detect any text in my application, so I was blaming it on the quality/format of my images.

Now today I have succeeded in getting (correct) text from a TIFF image using the application, but the very same image still fails (with the same exception) when I process it through the library. So I now have a reason to believe that there's some problem with my code. Has anyone successfully used MODI in C# (or VB.NET)?

Here's the code I'm using if that may help:

MODI.Document md = new MODI.Document();
string TempFile =@"Test.tif";
md.Create(TempFile);
md.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, false);

It throws exception on the 4th line.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top