VS2010做的C#微软MODI从图片识别文字(OCR)
Microsoft Visual Studio 2010做的C#微软MODI从图片识别文字(OCR)实例(需要引用Microsoft Office Document Imaging 12.0 Type Library Com组件),主要代码: try { MODI.Document doc = new MODI.Document(); doc.Create(sAbsFile); MODI.Image image; MODI.Layout layout; switch (iLanguageMode) { case 0: doc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true); break; case 1: doc.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, true, true); break; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < doc.Images.Cou nt; i++) { image = (MODI.Image)doc.Images[i]; layout = image.Layout; sb.Append(layout.Text); } return sb.ToString(); } catch (Exception ex) { return "【Error】" + ex.Message.ToString(); }
用户评论
正在做这方面
编译都通不过,要求返还积分