@ptrblck @Eta_C  I modified with this code, but this code executes but returns no results
 mat_fname_diff = pjoin('./sample_data/', 'img1taille500.mat')
    #print('Mat loading ...')
    mat_diff = sio.loadmat(mat_fname_diff)
    patches_diff = image.extract_patches_2d(mat_diff['img1taille500'], ((5,5)))
    print(mat_diff)
    abscice=[];
    cordonne=[];
    k=0;
    c=0;
    i=0;
    j=0;
    k1=0;
    abscice=[];
    ordonnee=[];
    x=train_x[k];
    k1=0
    while (k!=(4)):
      while((i!=20) and (j!=20) and (x[:5, :5] != (mat_diff['img1taille500'][i:i+5, j:j+5]))):
        j=j+1;
          # for j in range (95):

      if (x[:5, :5] == (mat_diff['img1taille500'][i:i+5, j:j+5])):
          x1= i+2;
          y1=j+2;
          #print("les axes",x1,y1)
          abscice= x1;
          ordonne=y1;
          print(abscice,ordonne)
          #c=c+1;
         
         
          k=k+1; 
          x=train_x[k];
          j=0;
          i=0;       
      elif (i==(20)):
          i=0;
          j=j+1;
      else :
          j=0;
          i=i+1;
   

helpp meee