画像ファイルの数を読み込もうとしていて、それらを互いに比較したいです。サイズ 5 の配列オブジェクトを作成し、それに 5 つの画像を割り当てました。配列オブジェクトをメソッドに渡して、各画像を比較しようとしました。しかし、それは私にエラーを示しています。誰でも私を助けることができますか?
File[] f= new File[5];
f[1]= new File("p1.png");
f[2]= new File("p2.png");
f[3]= new File("p3.png");
f[4]= new File("p4.png");
f[5]=new file("p5.png");
for(int i=1;i<5;i++)
{
compare(f[i],f[i++]);
}
public void compare(File fi[1],File fi[2])
{
BufferedImage image = ImageIO.read(fi[1]);
int width = image.getWidth(null);
int height = image.getHeight(null);
int[][] clr= new int[width][height];
BufferedImage images = ImageIO.read(fi[2]);
int widthe = images.getWidth(null);
int heighte = images.getHeight(null);
int[][] clre= new int[widthe][heighte];
}