mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: use normalized error to make decision about movement direction
Height is not a good determinant in movement direction, normalized error is much better. Should fix aes1610 and aes2501 driver issues.
This commit is contained in:
@@ -621,19 +621,12 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
|
||||
/* stop capturing if MAX_FRAMES is reached */
|
||||
if (aesdev->blanks_count > 10 || g_slist_length(aesdev->strips) >= MAX_FRAMES) {
|
||||
struct fp_img *img;
|
||||
unsigned int height, rev_height;
|
||||
|
||||
fp_dbg("sending stop capture.... blanks=%d frames=%d", aesdev->blanks_count, g_slist_length(aesdev->strips));
|
||||
/* send stop capture bits */
|
||||
aes_write_regv(dev, capture_stop, G_N_ELEMENTS(capture_stop), stub_capture_stop_cb, NULL);
|
||||
aesdev->strips = g_slist_reverse(aesdev->strips);
|
||||
height = fpi_do_movement_estimation(&assembling_ctx, aesdev->strips, aesdev->strips_len, FALSE);
|
||||
rev_height = fpi_do_movement_estimation(&assembling_ctx, aesdev->strips, aesdev->strips_len, TRUE);
|
||||
fp_dbg("heights: %d rev: %d", height, rev_height);
|
||||
if (rev_height < height) {
|
||||
fp_dbg("Reversed direction");
|
||||
height = fpi_do_movement_estimation(&assembling_ctx, aesdev->strips, aesdev->strips_len, FALSE);
|
||||
}
|
||||
fpi_do_movement_estimation(&assembling_ctx, aesdev->strips, aesdev->strips_len);
|
||||
img = fpi_assemble_frames(&assembling_ctx, aesdev->strips, aesdev->strips_len);
|
||||
img->flags |= FP_IMG_PARTIAL;
|
||||
g_slist_free_full(aesdev->strips, g_free);
|
||||
|
||||
@@ -490,19 +490,10 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
|
||||
aesdev->no_finger_cnt++;
|
||||
if (aesdev->no_finger_cnt == 3) {
|
||||
struct fp_img *img;
|
||||
unsigned int height, rev_height;
|
||||
|
||||
aesdev->strips = g_slist_reverse(aesdev->strips);
|
||||
height = fpi_do_movement_estimation(&assembling_ctx,
|
||||
aesdev->strips, aesdev->strips_len, FALSE);
|
||||
rev_height = fpi_do_movement_estimation(&assembling_ctx,
|
||||
aesdev->strips, aesdev->strips_len, TRUE);
|
||||
fp_dbg("heights: %d rev: %d", height, rev_height);
|
||||
if (rev_height < height) {
|
||||
fp_dbg("Reversed direction");
|
||||
height = fpi_do_movement_estimation(&assembling_ctx,
|
||||
aesdev->strips, aesdev->strips_len, FALSE);
|
||||
}
|
||||
fpi_do_movement_estimation(&assembling_ctx,
|
||||
aesdev->strips, aesdev->strips_len);
|
||||
img = fpi_assemble_frames(&assembling_ctx,
|
||||
aesdev->strips, aesdev->strips_len);
|
||||
img->flags |= FP_IMG_PARTIAL;
|
||||
|
||||
Reference in New Issue
Block a user