Tag: modi

在C#中使用MODI进行OCR。 需要从内存中读取图像,而不是磁盘

我正在尝试使用MODI在内存中已有的位图上执行OCR。 我似乎无法找到解决方案,因为我找到的所有示例都使用create方法从磁盘中获取图像并为OCR做好准备。但是,我已经在内存上有图像并且写入和读取了我往返磁盘会消耗太多时间。 Bitmap bmp = … //Instantiate the MODI.Document object MODI.Document md = new MODI.Document(); //The Create method grabs the picture from disk snd prepares for OCR. md.Create(“C:\\bmp.gif”); //but I don’t want to read from disk 🙁 //Do the OCR. md.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true); //Get the first (and only image) MODI.Image image = (MODI.Image)md.Images[0]; //Get the […]

Windows 7 OCR API

我一直在审查Office 2007 MODI OCR的替代品(OneNote的2010解决方案质量/结果比2007年更低:-()。我注意到一旦安装了可选的tifffilter ,Windows 7就包含一个OCR库 OCR组件已安装到 %programfiles%\Common Files\microsoft shared\OCR\7.0\xocr3.psp.dll 但我没有看到任何API? 有没有人看到如何在C#中优化界面? 解答:找到解决方案,一旦安装了可选的tiff ifilter win7function,我就可以使用http://www.codeproject.com/KB/cs/IFilter.aspx上的代码/ exe获取截图的文本输出。 另外,如果为.png和.jpg添加相同的[HKEY_CLASSES_ROOT.tiff \ PersistentHandler],那么OCR也适用于jpg和png。

.NET OCRing图像

我正在尝试使用MODI来OCR一个窗口的程序。 它适用于截图我使用win32 interop以编程方式抓取,如下所示: public string SaveScreenShotToFile() { RECT rc; GetWindowRect(_hWnd, out rc); int width = rc.right – rc.left; int height = rc.bottom – rc.top; Bitmap bmp = new Bitmap(width, height); Graphics gfxBmp = Graphics.FromImage(bmp); IntPtr hdcBitmap = gfxBmp.GetHdc(); PrintWindow(_hWnd, hdcBitmap, 0); gfxBmp.ReleaseHdc(hdcBitmap); gfxBmp.Dispose(); string fileName = @”c:\temp\screenshots\” + Guid.NewGuid().ToString() + “.bmp”; bmp.Save(fileName); return fileName; } […]