各位大能,哪有C#下免费使用的OCR?

解决方案 »

  1.   

    有,msoffice 的MODI(Microsoft Office Document Imaging),英文识别还不错
      

  2.   


    public static extern IntPtr OCR(string file, int type);[DllImport("AspriseOCR.dll", EntryPoint = "OCRpart")]
    static extern  IntPtr OCRpart(string file, int type, int startX, int startY, int width, int height);[DllImport("AspriseOCR.dll", EntryPoint = "OCRBarCodes")]
    static extern IntPtr OCRBarCodes(string file, int type);[DllImport("AspriseOCR.dll", EntryPoint = "OCRpartBarCodes")]
    static extern IntPtr OCRpartBarCodes(string file, int type, int startX, int startY, int width, int height);private void GetVeryfyCode(string _imgPath)
    {
    if(File.Exists(_imgPath))//ok now?
    {
    try
    {
    this.picbVeryfyCode.Image=System.Drawing.Bitmap.FromFile(_imgPath);
    _veryfyCode=Marshal.PtrToStringAnsi(OCR(_imgPath, -1));
    _veryfyCode=_veryfyCode.Substring(0,4);
    this.label1.Text=_veryfyCode;
    }
    catch(Exception e)
    {
    this.label1.Text+=e.Message;
    }
    }
    }
      

  3.   

    更正[DllImport("AspriseOCR.dll", EntryPoint="OCR")]
    public static extern IntPtr OCR(string file, int type);[DllImport("AspriseOCR.dll", EntryPoint = "OCRpart")]
    static extern  IntPtr OCRpart(string file, int type, int startX, int startY, int width, int height);[DllImport("AspriseOCR.dll", EntryPoint = "OCRBarCodes")]
    static extern IntPtr OCRBarCodes(string file, int type);[DllImport("AspriseOCR.dll", EntryPoint = "OCRpartBarCodes")]
    static extern IntPtr OCRpartBarCodes(string file, int type, int startX, int startY, int width, int height);private void GetVeryfyCode(string _imgPath)
    {
    if(File.Exists(_imgPath))//ok now?
    {
    try
    {
    this.picbVeryfyCode.Image=System.Drawing.Bitmap.FromFile(_imgPath);
    _veryfyCode=Marshal.PtrToStringAnsi(OCR(_imgPath, -1));
    _veryfyCode=_veryfyCode.Substring(0,4);
    this.label1.Text=_veryfyCode;
    }
    catch(Exception e)
    {
    this.label1.Text+=e.Message;
    }
    }
    }