Allow drivers to specify custom bz3 match threshold

aes4000 detects fewer minutiae and hence returns lower scores.
This commit is contained in:
Daniel Drake 2007-11-09 14:57:42 +00:00
parent e3451158e9
commit 71e4bb39ec
3 changed files with 12 additions and 1 deletions

View File

@ -220,6 +220,9 @@ struct fp_img_driver aes4000_driver = {
.img_width = 96,
.enlarge_factor = 3,
/* temporarily lowered until image quality improves */
.bz3_threshold = 9,
.init = dev_init,
.exit = dev_exit,
.capture = capture,

View File

@ -127,6 +127,7 @@ struct fp_img_driver {
int img_width;
int img_height;
unsigned int enlarge_factor;
int bz3_threshold;
/* Device operations */
int (*init)(struct fp_img_dev *dev, unsigned long driver_data);

View File

@ -186,12 +186,16 @@ int img_dev_enroll(struct fp_dev *dev, gboolean initial, int stage,
return FP_ENROLL_COMPLETE;
}
#define BOZORTH3_DEFAULT_THRESHOLD 40
static int img_dev_verify(struct fp_dev *dev,
struct fp_print_data *enrolled_print)
{
struct fp_img_dev *imgdev = dev->priv;
struct fp_img_driver *imgdrv = fpi_driver_to_img_driver(dev->drv);
struct fp_img *img;
struct fp_print_data *print;
int match_score = imgdrv->bz3_threshold;
int r;
r = fpi_imgdev_capture(imgdev, 0, &img);
@ -209,11 +213,14 @@ static int img_dev_verify(struct fp_dev *dev,
return FP_VERIFY_RETRY;
}
if (match_score == 0)
match_score = BOZORTH3_DEFAULT_THRESHOLD;
r = fpi_img_compare_print_data(enrolled_print, print);
fp_print_data_free(print);
if (r < 0)
return r;
if (r >= 40)
if (r >= match_score)
return FP_VERIFY_MATCH;
else
return FP_VERIFY_NO_MATCH;