2017-05-22 64 views
0

我有曼陀罗MFS100光学指纹传感器,我想构建一个android应用程序,显示正在扫描的手指的类型。检测曼陀罗指纹传感器的手指类型

我想让应用程序能够显示像拇指或索引这样的手指正在扫描。

注:我已经成功下载的口头禅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(); 
} 
功能
+0

你好, 你有没有从概率? 我在过去2周内为此搜索教程,但找不到任何东西。 请问我可以在哪里阅读文档并找到它的演示。 谢谢。 – Namy

回答

0

您的示例代码有助于捕获和提取图像(WSQ或ISO)或模板(ANSI)。

您必须使用功能将当前指纹与保存的指纹进行匹配。例如使用这种方法:mfs100.MatchISO

+0

@EnvironerInc,它有用吗? – LaurentY

0

Namy,从捕获的数据中识别手指的位置(例如LEFT_INDEX,LEFT_THUMB,RIGHT_INDEX等)是不可能的。你需要从你身边管理手指的位置。