-
Notifications
You must be signed in to change notification settings - Fork 15
Integrate sigfm algorithm #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I've merged the rootd changes (I originally did goodixtls but now I've also done sigfm). Note the example |
|
btw we should be able to just split this branch into the goodixtls only changes and the sigfm changes by just making two new branches and then removing the non-goodixtls/goodixtls files from the commit history for each respectively |
|
@0x00002a First of all, Thanks for your work! This is what's in my mind right now:
|
Yeah that is neat, I like it. What I can do then is like I said remove the goodixtls changes from this branch and make a goodixtls-sigfm using those. If we make this branch the sigfm one I can do it destructively (removing the files from each commit in the history) or non-destructively (adding a new commit that reverts the changes). Destructively is potentially cleaner overall but would require a force push to this branch (or a new PR) |
I'm for the destructive method since it's cleaner |
d024baf to
0f11ac8
Compare
|
@mpi3d OK, this branch should now just have the sigfm stuff on it I'm going to make a new PR with just the goodix changes, then another one on top of that with the goodix-sigfm branch, sound good? |
|
Ok thanks. Do you want me to merge it right now or you prefer to keep this open? |
|
Since I don't have push access to this repo its probably best to keep it open since it may need further changes I'm not sure |
|
Ok. But I may add some changes too (When I have time of course 🙂). So first I'll ask @rootd to give you write access. |
Can you explain this a bit more please. I don't understand what binary serialization/deserialization is. |
I think that libfprint will prefer to have everything written in pure C and only have bindings to C++. |
I think we can ignore this in a first time. |
|
Just for you to know I didn't read the code yet. |
|
Wait. Last commit should be cleaned too. |
depends what you mean by "bindings"? libfprint main is still pure C and compiler by the c compiler, sigfm is compiled by the c++ compiler and needs to be c++ to use opencv |
That should be ok then. |
now it uses a proper binary serialization, but this will break any stored enrolls with the old format
I think that we should use |
I don't think they have a styling guide. They just have a script: |
Thats just what I was looking for, thanks! |
798bfb3 to
f7969d3
Compare
|
OK I've run uncrustify using their config over the history and it seems to have worked |
Done |
mpi3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some remaining sfm strings. I hope I didn't forget one. Can you update that please?
|
That should've got them all, I just did |
|
Everything seems fine but I still need to check some things here and there. |
|
Works great with elan 0c6e(sensor size 150x52), I was even able to switch from swiping to touch. |
|
We will need to remove formatting of non SIGFM related lines (unmodified lines) in commits. Otherwise libfprint devs will reject them. New and edited lines should use the recommended format. But we shouldn't try to format the entire libfprint code (at least not on this branch). |
Co-authored-by: Dinolek <[email protected]>
|
I'll merge. Then I need to edit things before the libfprint merge. |
This integrates the sigfm algorithm into libfprint. It is now just the sigfm part, I've removed the goodixtls changes from the history
Results are pretty good, as long as you make sure to move your finger around on the scanner when enrolling so it gets lots of different shots, the acceptance rate is pretty high and I've so far got no false positives.
Where do I find the goodixtls branch with these changes?
Currently I have a branch that integrates this PR and #13 + a single commit to enable sigfm for the driver. Also there is an aur package
PR outline
C++/sigfm side
opencv(and alsodoctestfor the tests, handled by a wrap so its automatic install), 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 muchsigfm.hpp(maybe should rename to.h?) which forward declares theSfmImgInfostruct and all the functions for dealing with the algorithmSfmImgInfostruct 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)streamstruct and some template magic (which would be less horrible with c++20 concepts)C/libfprint side
algorithm, which lets you pick between sigfm or nbis (defaulting to nbis), this is used to initalise prints which also store their algorithm (type)FpImage's now store anSfmImgInfo*alongside the minutiae, this will be uninitialised untilfp_image_extract_sfm_infois called (mirroringminutiaeandfp_image_detect_minutiae), this is called automatically byfpi_image_device_image_capturedif the device uses sigfm (same as for nbis and minutiae)From the perspective of drivers, all thats needed is to add
<image device class ptr>->algorithm = FPI_DEVICE_ALGO_SIGFMand libfprint will do the rest.Breaking changes that need discussion
bz3_thresholdis now also used for the threshold for sigfm scores. Ideally it would be renamed to likescore_thresholdor something but this would require refactoring all the existing drivers (which is piss easy with tooling but probably needs to be discussed with upstream)