zoukankan      html  css  js  c++  java
  • 验证码ORC

    调用微软的Microsoft Office Document Imaging的类库

    源代码如下:

    public MODI.Document _MODIDocument;
    private void SetImage(string filename)
    {

    // Bitmap nump = new Bitmap();
    // Bitmap myBitmap1 = new Bitmap(new fa;
    // set the image..
    try
    {
    _MODIDocument = new MODI.Document();
    _MODIDocument.Create(filename);
    //axMiDocView1.Document = _MODIDocument;
    //axMiDocView1.Refresh();
    }
    catch (System.Runtime.InteropServices.COMException ee)
    {
    MessageBox.Show(ee.Message);
    }
    }

    public string Analyse()
    {
    string texts = "";
    if (_MODIDocument == null) return texts;
    try
    {
    // add event handler for progress visualisation
    //_MODIDocument.OnOCRProgress += new MODI._IDocumentEvents_OnOCRProgressEventHandler(this.ShowProgress);

    // the MODI call for OCR
    // _MODIDocument.OCR(_MODIParameters.Language,_MODIParameters.WithAutoRotation,_MODIParameters.WithStraightenImage);
    _MODIDocument.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, true, true);

    //this.textBox1.Text = (_MODIDocument.Images[0] as MODI.Image).Layout.Text;
    //MessageBox.Show((_MODIDocument.Images[0] as MODI.Image).Layout.Text);
    texts = (_MODIDocument.Images[0] as MODI.Image).Layout.Text;
    //statusBar1.Text = "Ready.";

    _MODIDocument.Close(false);
    _MODIDocument = null;

    }
    catch (Exception ee)
    {
    // simple exception "handling"
    MessageBox.Show(ee.Message);
    }
    return texts;
    }

  • 相关阅读:
    repo
    manifest
    Gerrit使用简介
    id_rsa id_rsa.pub
    数字签名原理及其应用
    RSA DSA
    ssh(安全协议外壳)
    Numpy基本数据结构
    Numpy
    .bat 批处理
  • 原文地址:https://www.cnblogs.com/NoRoad/p/1740805.html
Copyright © 2011-2022 走看看