Bonjour à tous,

Je cherche le code-source de la transformation Arnold et inverse-transformation Arnold.

Dans le code suivant, il y a des erreurs de spécification
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
public static BufferedImage image_brouillage(BufferedImage marque_originale,int cpt ){
     int m=marque_originale.getWidth();
     int n=marque_originale.getHeight() ;  
     Matrix[] matrices=ImageMatrixConversion.image3Matrix(marque_originale) ;
 
     int i1=0,j1=0 ;
 
     while(cpt > 0)
     {
     for(int i=0;i<m;i++){
         for(int j=0;j<m;j++){
             i1=(i+j)%m ;
             j1=(i+2*j)%m;
            if(i1> m)
                 i1=i1%m ;
             if(j1> m)
                 j1=j1%m ;
             if(i1== 0)
                 i1=m-1 ;
             if(j1 == 0)
                 j1=m-1 ;
 
            matrices[0].set(i, j, matrices[0].get(i1, j1));
            matrices[1].set(i, j, matrices[1].get(i1, j1));
            matrices[2].set(i, j, matrices[2].get(i1, j1));
         }   
     }
     cpt--; 
     }
      BufferedImage newbuffImg  =ImageMatrixConversion.matrix3Image(matrices) ;
        return newbuffImg;
    }
 
     public static BufferedImage image_debrouillage(BufferedImage marque_originale ,int N){
     int m=marque_originale.getWidth() ;
     int n=marque_originale.getHeight() ;  
     Matrix[] matrices=ImageMatrixConversion.image3Matrix(marque_originale) ;
 
     int i1=0,j1=0 ;
     double  T=1.4938*N+40.8689; 
     double cpt=Math.ceil(T) - 9;
     cpt=49-9;
     while(cpt > 0)
     {
 
     for(int i=0;i<m;i++){
         for(int j=0;j<n;j++){
 
             i1=(2*i-j) % m ;
             j1=(-i+j)% m;
 
             matrices[0].set(i1, j1, matrices[0].get(i, j));
             matrices[1].set(i1, j1, matrices[1].get(i, j));
             matrices[2].set(i1, j1, matrices[2].get(i, j)); 
         }   
     }
     cpt--; 
     }
      BufferedImage newbuffImg  =ImageMatrixConversion.matrix2Image(matrices) ;
        return newbuffImg;
    }
Quelqu'un saurait-il m'indiquer comment les corriger ?

Merci d'avance pour votre aide.