zoukankan      html  css  js  c++  java
  • c#图片识别之AspriseOCR


    Asprise-OCR的使用。

    Asprise-OCR下载地址:

    http://asprise.com/product/ocr/download.php?lang=csharp

    其中需要使用的3个dll是AspriseOCR.dll、DevIL.dll、ILU.dll。

    需要注意的是这几个.dll是vc写的引用要在程序中用DllImport引用,关键代码:

    [DllImport("AspriseOCR.dll", EntryPoint = "OCR", CallingConvention = CallingConvention.Cdecl)]
    
    public static extern IntPtr OCR(string file, int type);
    
    [DllImport("AspriseOCR.dll", EntryPoint = "OCRpart", CallingConvention = CallingConvention.Cdecl)]
    
    static extern IntPtr OCRpart(string file, int type, int startX, int startY, int width, int height);
    
    [DllImport("AspriseOCR.dll", EntryPoint = "OCRBarCodes", CallingConvention = CallingConvention.Cdecl)]
    
    static extern IntPtr OCRBarCodes(string file, int type);
    
    [DllImport("AspriseOCR.dll", EntryPoint = "OCRpartBarCodes", CallingConvention = CallingConvention.Cdecl)]
    
    static extern IntPtr OCRpartBarCodes(string file, int type, int startX, int startY, int width, int height);

    以上是非托管代码的引用方法,不用再在项目里引用()


    MessageBox.Show(Marshal.PtrToStringAnsi(OCRpart(img_path, -1, startX, startY, width, height)));

  • 相关阅读:
    prayer OJ M
    51nod1295
    纪念第一次ak。。。
    noip2007-4
    51nod1344
    51nod1079
    51nod1537
    51nod1269Devu and Flowers
    python基本数据类型之列表list
    Python基本数据类型
  • 原文地址:https://www.cnblogs.com/bile/p/3131263.html
Copyright © 2011-2022 走看看