First You Have To Compare Image Height And Width .. if It is Same then You Have To compare Bytes Pixel.
Check Height And Width.
if (image1.getHeight() != image2.getHeight()){
return false;
}
if (image1.getWidth() != image2.getWidth()){
return false;
}
Then Check Image Pixel
for (int i = 0; i < image1.getWidth(); i++)
{
for (int j = 0; j < image1.getHeight(); j++)
{
if (image1.getPixel(i,j) == image2.getPixel(i,j))
{
// Do whatever you want Correct Image.. // both image Are Same
}
else
{
// both image Are diffrent
}
}
}
Full Code Look Like
if (image1.getHeight() != image2.getHeight()){
isImageSame = false;
return;
}
if (image1.getWidth() != image2.getWidth()){
isImageSame = false;
return;
}
if(isImageSame){
for (int i = 0; i < image1.getWidth(); i++)
{
for (int j = 0; j < image1.getHeight(); j++)
{
if (image1.getPixel(i,j) == image2.getPixel(i,j))
{
// Do whatever you want Correct Image.. // both image Are Same
}
else
{
// both image Are diffrent
}
}
}
}
you Can Also Do it By OpenCV lib
also find Good Example here https://github.com/opencv/opencv/tree/master/samples/android/face-detection