I am using the code below to get pixel by supplying the bitmap
public int[] foo(Bitmap bitmapFoo) {
int[] pixels;
// Bitmap bitmapFoo ;
int height = bitmapFoo.getHeight();
int width = bitmapFoo.getWidth();
pixels = new int[height * width];
bitmapFoo.getPixels(pixels, 0, width, 1, 1, width - 1, height - 1);
return pixels;
}
now how do I compare it to similar image??
int[] i = foo(img2);
int[] i2 = foo(img1);
if (i==i2) {
txt.setText("same");
}else{
txt.setText("different");
}
Even if the image is similar not same it still shows different .How to avoid it ??
Is the comparison correct ?? or I am doing something wrong ??