/**
 * Compares two fingerprints data and returns a matching value.
 * 
 * @param env the Java Environment pointer. 
 * @param cls a reference to the caller class.
 * @param fp1 the first fingerprint data (an jobject of type jlibfprint/JlibFprint$fp_print_data).
 * @param fp2 the second fingerprint data (an jobject of type jlibfprint/JlibFprint$fp_print_data).
 * @return a measure of the similarities between fp1 and fp2.
 */
JNIEXPORT jint JNICALL Java_jlibfprint_JlibFprint_img_1compare_1print_1data(JNIEnv *env, jclass cls, jobject fp1, jobject fp2)
{
    fp_print_data fpd1, fpd2;
    jint retVal; 
    
    jfp2cfp(env, fp1, fpd1);
    jfp2cfp(env, fp2, fpd2);
    
    retVal = static_cast<jint>(fpi_img_compare_print_data(&fpd1, &fpd2));
    
    memset(&fpd1, 0, sizeof(fp_print_data));
    memset(&fpd2, 0, sizeof(fp_print_data));
    
    return retVal;
}
Esempio n. 2
0
static void verify_process_img(struct fp_img_dev *imgdev)
{
	struct fp_img_driver *imgdrv = fpi_driver_to_img_driver(imgdev->dev->drv);
	int match_score = imgdrv->bz3_threshold;
	int r;

	if (match_score == 0)
		match_score = BOZORTH3_DEFAULT_THRESHOLD;

	r = fpi_img_compare_print_data(imgdev->dev->verify_data,
		imgdev->acquire_data);

	if (r >= match_score)
		r = FP_VERIFY_MATCH;
	else if (r >= 0)
		r = FP_VERIFY_NO_MATCH;

	imgdev->action_result = r;
}