我正在尝试使用 MODI 对内存中已有的位图执行 OCR。我似乎找不到解决方案,因为我发现的所有示例都使用 create 方法从磁盘中获取图像并为 OCR 准备它。但是,我已经在内存中保存了图像并且可以写入和读取 i往返磁盘消耗了太多时间。
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 layout.
MODI.Layout layout = image.Layout;