1 / 8
文档名称:

数字验证码的识别.doc

格式:doc   大小:42KB   页数:8页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

数字验证码的识别.doc

上传人:sxlw2016 2018/7/23 文件大小:42 KB

下载得到文件列表

数字验证码的识别.doc

文档介绍

文档介绍:数字验证码的识别
数字验证码很多地方都会用到,我前段时间也写过一篇有关于生成验证码的文章,那是随机生成大小不一,颜色不一,形状不一的数字图片,本文主要是针对那些比较规范的验证码的识别,何谓规范?规范就是数字的大小几乎一致,颜色对比度挺高,,比对,先取样,保存成字模,再用字模去和将要识别的图片进行比较,.
下面就是识别部份的代码:
 
/*
 * 
 *
 * Created on 2007年1月18日, 下午10:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
..;
import ;
import ;
import ;
import ;
import ;
import .URL;
import ;
/**
 * 验证码识别程序
 * ***@author hadeslee
 */
public class ImageCode {
    
    private BufferedImage bi;
    private static int[][][] model=new int[5][10][208];
    //静态初始化块
    static{
        initNumModel();
    }
    
    
    
/**
     * Creates a new instance of ImageCode
     */
    public ImageCode() {
        initNumModel();
    }
    
    public String getNumber(InputStream is){
        try{
            bi= ( is );
            final StringBuffer sb=new StringBuffer();
            for(int i=0;i<4;i++){
                int[] data=(i);
                ((data));
            }
            return ();
        } catch(Exception exe){
            ()