add sigfm algorithm implementation
This adds an implementation of the sigfm algorithm created by @mpi3d.
This algorithm is designed to work with small scanners, and can match off a single image rather than requiring a swipe with stitching. It has already been tested with the goodixtls 5110 sensor (#376) and seems to work.
PR outline
C++/sigfm side
- sigfm is added as another library to be built, and put at the same level as the other algorithms (e.g. nbis) in the tree
- the sigfm library depends on
opencv
(and alsodoctest
for the tests), and is built with c++. I'm not 100% sure which version of c++ is needed but I would guess at c++17, I've avoided c++20 as I don't want to restrict the compiler versions we can use too much - the sigfm library offers a C API in
sigfm.hpp
(maybe should rename to-- done) which forward declares the.h
?SigfmImgInfo
struct and all the functions for dealing with the algorithm - the
SigfmImgInfo
struct stores the extracted keypoints and descriptors, and the C api deals in pointers to it. This lets the api communicate with C and be threaded through the libfprint internal api while still having access to c++ niceties likestd::vector
(and preventing us from having to convert the keypoints and descriptors to some C type) - serialisation and deserialisation to binary is also supported (needed by libfprint to store enrolled fingerprints), it uses a homemade
stream
struct and some template magic (which would be less horrible with c++20 concepts)
C/libfprint side
- There is a new option for the image device class
algorithm
, which lets you pick between sigfm or nbis (defaulting to nbis), this is used to initialise prints which also store their algorithm (type
) -
FpImage
's now store aSigfmImgInfo*
alongside the minutiae, this will be uninitialised untilfp_image_extract_sigfm_info
is called (mirroringminutiae
andfp_image_detect_minutiae
), this is called automatically byfpi_image_device_image_captured
if the device uses sigfm (same as for nbis and minutiae) - verification now checks the type of the print and either calls the bz3 matcher or the sigfm one
From the perspective of drivers, all thats needed is to add <image device class ptr>->algorithm = FPI_DEVICE_ALGO_SIGFM
and libfprint will do the rest.
Breaking changes that need discussion
-
bz3_threshold
is now also used for the threshold for sigfm scores. Ideally it would be renamed to likescore_threshold
or something but this would require refactoring all the existing drivers (which is piss easy with tooling but would be an api change going forward) -- renamed toscore_threshold
Edited by Natasha England-Elbro