我已将 sqlite 数据库中的指纹印象保存为 bitmap 。任何人都可以帮我提供android代码的源代码或链接,以将两个指纹印象作为位图进行比较。为了平等而匹配。
我尝试过使用以下代码。但它与存储在数据库中的所有指纹印象相匹配。
public boolean compare(Bitmap imageToCompare , Bitmap imageInDb )
{
System.out.println("Inside Compare");
System.out.println("imageToCompare::::"+imageToCompare);
System.out.println("imageInDb::::"+imageInDb);
/*int width = imageToCompare.getWidth();
System.out.println("width::::::"+width);
int height = imageToCompare.getHeight();
System.out.println("height::::"+height);
int pixelCount = width * height;
int width1 = imageInDb.getWidth();
System.out.println("width1::::::"+width1);
int height1 = imageInDb.getHeight();
System.out.println("height1::::"+height1);*/
int pixelCount = mImageWidth * mImageHeight;
System.out.println("pixelCount::::"+pixelCount);
int[] pixels1 = new int[pixelCount];
int[] pixels2 = new int[pixelCount];
System.out.println("11111111111111111");
//imageToCompare.getPixels(pixels1, 0, 0, 0, width, height);
imageToCompare.getPixels(pixels1, 0,mImageWidth, 0, 0, mImageWidth, mImageHeight);
imageInDb.getPixels(pixels2, 0,mImageWidth, 0,0, mImageWidth, mImageHeight);
System.out.println("22222222222222");
for (int i = 0; i < pixelCount; i++) {
if (pixels1[i] != pixels2[i]) {
System.out.println("333333333333");
return false;
}
}
System.out.println("444444444444444444");
return true;
}
谢谢