我有 Mantra MFS100 光学指纹传感器,我想构建一个 android 应用程序来显示正在扫描的手指类型。
我想制作应用程序,使其可以显示正在扫描的手指,如拇指或索引。
注意:我已经成功下载了mantra MFS100 Android SDK,但是没有任何功能可以检测被扫描的手指类型
下面是开始捕获手指数据的函数
private void StartSyncCapture() {
// //// Use thread if you want to show preview, else no need to use
// thread.
new Thread(new Runnable() {
@Override
public void run() {
SetTextonuiThread("");
try {
FingerData fingerData = new FingerData();
int ret = mfs100.AutoCapture(fingerData, timeout, true,
false);
if (ret != 0) {
SetTextonuiThread(mfs100.GetErrorMsg(ret));
} else {
final Bitmap bitmap = BitmapFactory.decodeByteArray(
fingerData.FingerImage(), 0,
fingerData.FingerImage().length);
imgFinger.post(new Runnable() {
@Override
public void run() {
imgFinger.setImageBitmap(bitmap);
imgFinger.refreshDrawableState();
}
});
SetTextonuiThread("Capture Success");
String log = "\nQuality: " + fingerData.Quality()
+ "\nNFIQ: " + fingerData.Nfiq()
+ "\nWSQ Compress Ratio: "
+ fingerData.WSQCompressRatio()
+ "\nImage Dimensions (inch): "
+ fingerData.InWidth() + "\" X "
+ fingerData.InHeight() + "\""
+ "\nImage Area (inch): " + fingerData.InArea()
+ "\"" + "\nResolution (dpi/ppi): "
+ fingerData.Resolution() + "\nGray Scale: "
+ fingerData.GrayScale() + "\nBits Per Pixal: "
+ fingerData.Bpp() + "\nWSQ Info: "
+ fingerData.WSQInfo();
SetLogOnUIThread(log);
//////////////////// Extract ANSI Template
byte[] tempData = new byte[2000]; // length 2000 is mandatory
byte[] ansiTemplate = null;
int dataLen = mfs100.ExtractANSITemplate(fingerData.RawData(), tempData);
if(dataLen<=0)
{
if(dataLen==0)
{
SetTextonuiThread("Failed to extract ANSI Template");
}
else
{
SetTextonuiThread(mfs100.GetErrorMsg(dataLen));
}
return;
}
else
{
ansiTemplate = new byte[dataLen];
System.arraycopy(tempData, 0, ansiTemplate, 0,
dataLen);
}
//////////////////////////////////////////////
//////////////////// Extract ISO Image
dataLen=0;
tempData = new byte[(mfs100.GetDeviceInfo().Width() * mfs100.GetDeviceInfo().Height())+1078];
byte[] isoImage = null;
dataLen = mfs100.ExtractISOImage(fingerData.RawData(),tempData);
if(dataLen<=0)
{
if(dataLen==0)
{
SetTextonuiThread("Failed to extract ISO Image");
}
else
{
SetTextonuiThread(mfs100.GetErrorMsg(dataLen));
}
return;
}
else
{
isoImage = new byte[dataLen];
System.arraycopy(tempData, 0, isoImage, 0,
dataLen);
}
//////////////////////////////////////////////
//////////////////// Extract WSQ Image
dataLen=0;
tempData = new byte[(mfs100.GetDeviceInfo().Width() * mfs100.GetDeviceInfo().Height())+1078];
byte[] wsqImage = null;
dataLen = mfs100.ExtractWSQImage(fingerData.RawData(),tempData);
if(dataLen<=0)
{
if(dataLen==0)
{
SetTextonuiThread("Failed to extract WSQ Image");
}
else
{
SetTextonuiThread(mfs100.GetErrorMsg(dataLen));
}
return;
}
else
{
wsqImage = new byte[dataLen];
System.arraycopy(tempData, 0, wsqImage, 0,
dataLen);
}
//////////////////////////////////////////////
SetData2(fingerData,ansiTemplate,isoImage,wsqImage);
}
} catch (Exception ex) {
SetTextonuiThread("Error");
}
}
}).start();
}