private BufferedImage twistImage(BufferedImage tag) {  
        double dMultValue = random.nextInt(7) + 3;// 波形的幅度倍数，越大扭曲的程序越高，一般为3  
        double dPhase = random.nextInt(6);// 波形的起始相位，取值区间（0-2＊PI）  

        BufferedImage destBi = new BufferedImage(tag.getWidth(),  
        		tag.getHeight(), BufferedImage.TYPE_INT_RGB);  

        for (int i = 0; i < destBi.getWidth(); i++) {  
            for (int j = 0; j < destBi.getHeight(); j++) {  
                int nOldX = getXPosition4Twist(dPhase, dMultValue,  
                        destBi.getHeight(), i, j);  
                int nOldY = j;  
                if (nOldX >= 0 && nOldX < destBi.getWidth() && nOldY >= 0  
                        && nOldY < destBi.getHeight()) {  
                    destBi.setRGB(nOldX, nOldY, tag.getRGB(i, j));  
                }  
            }  
        }  
        return destBi;  
    }