文档介绍:数字验证码的识别
数字验证码很多地方都会用到,我前段时间也写过一篇有关于生成验证码的文章,那是随机生成大小不一,颜色不一,形状不一的数字图片,本文主要是针对那些比较规范的验证码的识别,何谓规范?规范就是数字的大小几乎一致,颜色对比度挺高,,比对,先取样,保存成字模,再用字模去和将要识别的图片进行比较,.
下面就是识别部份的代码:
 
/*
 * 
 *
 * 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){
            ()