paip.验证码识别----判断汉字还是英文

paip.验证码识别----判断汉字还是英文


----作者Attilax , 1466519819@qq.com---  


在验证码识别中,判断汉字还是英文是非常重要的一个手段,可以大大提高综合识别率


结合原理就是:去噪后。力度比正常使用大点。汉字一般比英文笔划多,不容易细线去掉。


然后到得ROI,


主要是综合断点其PIXNUM和WIDTH就可以识别其是汉字了。


源码如下


 






public class Iskipper
    {


       public int pixnum;
       public int imgwidth;
       public string msg;
       public virtual bool isSkip(System.Drawing.Image image)
        {
            imgPedwe c = new imgPedwe();
            int num = c.pixProcess4rrv3((Bitmap)image);
            pixnum = num;
            msg = "<iskiper>picnum:" + pixnum.ToString();
            if (num > 900)
            {
                imgwidth = image.Width;
                msg = msg + ";imgwidth:" + imgwidth.ToString();
                if (image.Width > 82)
                {
                    msg += ";pic is maybe hanzi";
                    return true;
                }else
            
                return false;


            }


         




             imgwidth = image.Width;
             msg = msg + ";imgwidth:" + imgwidth.ToString();
            //if (image.Width > 82)
            //{
            //    msg += ";pic is maybe hanzi";
            //    return true;
            //}




            if (image.Width < 40)
            {
                msg += ";pic is maybe jelye";
                return true;
            }


            return false;












        }
    }
posted @ 2013-02-26 02:42  attilaxAti  阅读(32)  评论(0编辑  收藏  举报