zoukankan      html  css  js  c++  java
  • C#调用DLL实现图像文字识别(OCR)

    请先下载http://asprise.com/product/ocr/index.php?lang=csharp 的SDK.里面提供了详细的OCR方法,如下:

    将发现图像框picbVeryfyCode里的文字和文本框.txtVeryfyCode.Text是一致的.

    数字识别率我碰到的几乎是100%

    http://blog.csdn.net/crabo/

    [DllImport("AspriseOCR.dll")]
      static extern string craboOCR(string file, int type);

    private void GetVeryfyCode()
      {
    if(File.Exists(_imgPath))//ok now?
       {
        try
        {
        this.picbVeryfyCode.Image=System.Drawing.Bitmap.FromFile(_imgPath);
         _veryfyCode=craboOCR(_imgPath,-1);   //将返回string,并以"\r\n"结尾!!
         _veryfyCode=_veryfyCode.Substring(0,4);
         this.txtVeryfyCode.Text=_veryfyCode;
        }
        catch(Exception e)
        {
         this.lblResult.Text+=e.Message;
        }
       }
    }

    此文转载自opent.cn:http://www.opent.cn/a/092/770.shtml

  • 相关阅读:
    CF891E Lust
    Comet OJ 2019 夏季欢乐赛题解
    CF1098E Fedya the Potter
    CF1063F String Journey
    P4218 [CTSC2010]珠宝商
    AGC028 E
    51Nod 1584 加权约数和
    51Nod 1769 Clarke and math2
    Educational Codeforces Round 67
    斯特林数学习笔记
  • 原文地址:https://www.cnblogs.com/scgw/p/1885121.html
Copyright © 2011-2022 走看看