我一直在努力让MODI在今天正常工作。下面是在维基百科条目MODI给我试图使用的代码(改编自VB使用MODI 2003使用C#时出现“OCR运行错误”
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;
}
当我执行此,我得到一个错误的OCR()行说以下内容:
System.Runtime.InteropServices.COMException was unhandledMessage=OCR running error Source="" ErrorCode=-959967087
现在,我抬头一看是错误的代码,发现另一计算器question中,他们发现,他们不能在小的图像运行OCR,但一个问题是1700
X 2338
,这应该是足够足够大为原因。
有没有人有什么建议下一步该怎么去?
这导致当你有小于10字号charachters脏话错误.. –