0
我有一張圖片和一張旋轉的圖片進行比較。比較java中的旋轉圖像
if (this.img.getHeight() == img1.getWidth() && this.img.getWidth() == img1.getHeight()) {
for (int i = 0; i < this.img.getWidth(); i++) {
for (int j = 0; j < this.img.getHeight(); j++) {
assertEquals(this.img.getRGB(i, j), img1.getRGB(this.img.getWidth() - j, i));
}
}
}
這是我使用的循環,但它不起作用。
圖片順時針旋轉90°。
this.img
是原始圖片,img1
是旋轉圖片。有人可以幫幫我嗎?提前致謝!
是否有錯誤? – Reflection
不,它只是告訴我rgb不一樣,但我知道它是一樣的。 –