I'm struggling to get MODI to work fine today. Here's the code I'm trying to use (adapted from the VB specified in the Wikipedia entry for MODI .
private void button1_Click( object sender, EventArgs e ) { string inputFile = @"C:\testImage.bmp"; textBox1.Text = GetTextFromImage( inputFile ); } private string GetTextFromImage( string fileName ) { string output = ""; var doc1 = new MODI.Document(); doc1.Create( fileName ); doc1.OCR( MiLANGUAGES.miLANG_ENGLISH, false, false ); for ( int i = 0; i < doc1.Images.Count; i++ ) { output += doc1.Images[i].Layout.Text; } doc1.Close(); return output; }
When I do this, I get an error in the OCR () line saying the following:
System.Runtime.InteropServices.COMException was unhandledMessage=OCR running error Source="" ErrorCode=-959967087
Now I looked through this error code and found another stackoverflow question in which they found that they cannot run OCR on small images, but one of them is 1700 x 2338 , which should be big enough for a reason.
Does anyone have any tips on where to go next?
source share