如何在Android中集成指纹锁 [英] How to Integrate fingerprint lock in Android

查看:209
本文介绍了如何在Android中集成指纹锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android开发的新手.现在,我想在我的应用程序中集成指纹锁.哪一个是最好的.请帮我找到好的指纹锁.

I am new to Android Development. Now I want to integrate Fingerprint lock in my application. Which is the best. Please help me to find good fingerprint lock.

推荐答案

将相机用作手指锁

作为参考检查此 使用相机的指纹扫描仪

作为对这个确切问题进行了大量研究的人,我可以告诉您,使用任何当前Android设备上的普通相机很难获得合适的图像以进行模板(特征提取).主要的使人衰弱的问题是在手指的脊和谷之间形成明显的对比.商用光学指纹扫描仪(您正在尝试模仿)通常通过棱镜中受阻的全内反射来获得必要的对比度.

As someone who's done significant research on this exact problem, I can tell you it's difficult to get a suitable image for templating (feature extraction) using a stock camera found on any current Android device. The main debilitating issue is achieving significant contrast between the finger's ridges and valleys. Commercial optical fingerprint scanners (which you are attempting to mimic) typically achieve the necessary contrast through frustrated total internal reflection in a prism.

生物识别技术中的FTIR

FTIR in Biometrics

在这种情况下,来自与棱镜接触的脊的光将传输到CMOS传感器,而来自谷的光则不会.您根本无法从Android相机可靠地获得相同的结果,但这并不意味着您无法在理想条件下获得可用的东西.

In this case, light from the ridges contacting the prism are transmitted to the CMOS sensor while light from the valleys are not. You're simply not going to reliably get the same kind of results from an Android camera, but that doesn't mean you can't get something useable under ideal conditions.

我用一台商用光学指纹扫描仪(Futronics FS80)在左边拍摄图像,用普通相机(15MP Cannon DSLR)拍摄了右边图像.裁剪,反转(以符合其他扫描仪的约定),对比后等摄像头图像,我们得到了以下结果.

I took the image on the left with a commercial optical fingerprint scanner (Futronics FS80) and the right with a normal camera (15MP Cannon DSLR). After cropping, inverting (to match the other scanner's convention), contrasting, etc the camera image, we got the following results.

在此处输入图片描述

摄像机图像的对比度很低.

The low contrast of the camera image is apparent.

在此处输入图片描述

但是该软件能够准确确定山脊流量.

But the software is able to accurately determine the ridge flow.

在此处输入图片描述

最后我们找到了相当数量的匹配细节(标有红色圆圈)

And we end up finding a decent number of matching minutia (marked with red circles.)

这是个坏消息.很难对这些类型的指尖进行近距离拍摄.我使用带闪光灯的数码单反相机来达到这些效果.另外,大多数指纹匹配算法不是尺度不变的.因此,如果在随后的扫描"中手​​指距离相机更远,则可能与原始手指不匹配.

Here's the bad news. Taking these types of up close shots of the tip of a finger is difficult. I used a DSLR with a flash to achieve these results. Additionally most fingerprint matching algorithms are not scale invariant. So if the finger is farther away from the camera on a subsequent "scan", it may not match the original.

我用于可视化的软件包是出色的且获得BSD许可的SourceAFIS.尽管目前仅移植到C#和Java(受限制),但也没有企业开源版本"/付费版本"的恶作剧.

The software package I used for the visualizations is the excellent and BSD licensed SourceAFIS. No corporate "open source version"/ "paid version" shenanigans either although it's currently only ported to C# and Java (limited).

非基于相机的解决方案:

Non Camera Based Solutions:

对于少数具有支持"USB主机模式"的硬件的设备,您可以编写自定义驱动程序以将指纹扫描仪与Android集成.老实说,对于这两个模型,我这样做是非常痛苦的.我通过使用Wireshark在扫描仪和具有有效驱动程序的linux盒之间嗅探USB数据包,然后根据所嗅探的命令编写Android驱动程序来实现这一目标.

For the frightening small number of devices that have hardware that support "USB Host Mode" you can write a custom driver to integrate a fingerprint scanner with Android. I'll be honest, for the two models I've done this for it was a huge pain. I accomplished it by using wireshark to sniff USB packets between the scanner and a linux box that had a working driver and then writing an Android driver based on the sniffed commands.

交叉编译FingerJetFX

Cross Compiling FingerJetFX

一旦您找到了一种图像采集解决方案(这两个潜在的解决方案都有其缺点),您就可以开始担心让FingerJetFX在Android上运行.首先,您将使用他们的SDK编写一个自包含的C ++程序,该程序会获取图像并将其转换为模板.之后,您确实有两个选择.

Once you have worked out a solution for image acquisition (both potential solutions have their drawbacks) you can start to worry about getting FingerJetFX running on Android. First you'll use their SDK to write a self contained C++ program that takes an image and turns it into a template. After that you really have two options.

将其编译为库,并使用JNI与其进行接口. 将其编译为可执行文件,然后让您的Android程序将其作为子进程调用. 对于这两种情况,您都需要NDK.我从没使用过JNI,所以我会尊重别人对我们的看法.我总是倾向于选择路线2.对于该应用程序,我认为这是适当的,因为您只是在真正调用本机代码来做一件事,即对图像进行模板化.一旦您的本机程序运行并交叉编译,您就可以使用该问题的答案将其与android应用打包,并从您的Android代码中调用它.

Compile it to a library and use JNI to interface with it. Compile it to an executable and let your Android program call it as a subprocess. For either you'll need the NDK. I've never used JNI so I'll defer to the wisdom of others on how best us it. I always tend to choose route #2. For this application I think it's appropriate since you're only really calling the native code to do one thing, template your image. Once you've got your native program running and cross compiled you can use the answer to this question to package it with your android app and call it from your Android code.

这篇关于如何在Android中集成指纹锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆