Пример #1
0
        private uint MakeISO4Data(out byte[] ISOBuf)
        {
            string szTemp;

             listRet.Items.Add("ISO 19794-4 Data creation start...");
             listRet.Items.Add("OpenDevice start...");

             ISOBuf = null;

             uint nRet = m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);

             if (nRet == NBioAPI.Error.NONE)
             {
            NBioAPI.Type.HFIR hFIR, hAuditData;

            hAuditData = new NBioAPI.Type.HFIR();

            nRet = m_NBioAPI.Enroll(null, out hFIR, null, NBioAPI.Type.TIMEOUT.DEFAULT, hAuditData, null);

            if (nRet == NBioAPI.Error.NONE)
            {
               NBioAPI.Export.EXPORT_AUDIT_DATA exportAuditData;

               nRet = m_Export.NBioBSPToImage(hAuditData, out exportAuditData);

               if (nRet == NBioAPI.Error.NONE)
               {
                  nRet = NBioBSPISO4.ExportRawToISOV1(exportAuditData, false, NBioBSPISO4.COMPRESS_MOD.NONE, out ISOBuf);

                  if (nRet == NBioAPI.Error.NONE)
                  {
                     szTemp = "ISO 19794-4 Data Len: " + ISOBuf.Length;
                     listRet.Items.Add(szTemp);
                  }
                  else
                  {
                     szTemp = "ExportRawToISOV1 Error: " + nRet;
                     listRet.Items.Add(szTemp);
                  }
               }
               else
               {
                  szTemp = "NBioBSPToImage Error: " + nRet;
                  listRet.Items.Add(szTemp);
               }

               hFIR.Dispose();
               hAuditData.Dispose();
            }
            else
            {
               szTemp = "Enroll Error: " + nRet;
               listRet.Items.Add(szTemp);
            }

            m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
             }
             else
             {
            szTemp = "OpenDevice Error: " + nRet;
            listRet.Items.Add(szTemp);
             }

             return nRet;
        }
Пример #2
0
        private uint MakeISO4Data(out byte[] ISOBuf)
        {
            string szTemp;

            listRet.Items.Add("ISO 19794-4 Data creation start...");
            listRet.Items.Add("OpenDevice start...");

            ISOBuf = null;

            uint nRet = m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);

            if (nRet == NBioAPI.Error.NONE)
            {
                NBioAPI.Type.HFIR hFIR, hAuditData;

                hAuditData = new NBioAPI.Type.HFIR();

                nRet = m_NBioAPI.Enroll(null, out hFIR, null, NBioAPI.Type.TIMEOUT.DEFAULT, hAuditData, null);

                if (nRet == NBioAPI.Error.NONE)
                {
                    NBioAPI.Export.EXPORT_AUDIT_DATA exportAuditData;

                    nRet = m_Export.NBioBSPToImage(hAuditData, out exportAuditData);

                    if (nRet == NBioAPI.Error.NONE)
                    {
                        nRet = NBioBSPISO4.ExportRawToISOV1(exportAuditData, false, NBioBSPISO4.COMPRESS_MOD.NONE, out ISOBuf);

                        if (nRet == NBioAPI.Error.NONE)
                        {
                            szTemp = "ISO 19794-4 Data Len: " + ISOBuf.Length;
                            listRet.Items.Add(szTemp);
                        }
                        else
                        {
                            szTemp = "ExportRawToISOV1 Error: " + nRet;
                            listRet.Items.Add(szTemp);
                        }
                    }
                    else
                    {
                        szTemp = "NBioBSPToImage Error: " + nRet;
                        listRet.Items.Add(szTemp);
                    }

                    hFIR.Dispose();
                    hAuditData.Dispose();
                }
                else
                {
                    szTemp = "Enroll Error: " + nRet;
                    listRet.Items.Add(szTemp);
                }

                m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
            }
            else
            {
                szTemp = "OpenDevice Error: " + nRet;
                listRet.Items.Add(szTemp);
            }

            return(nRet);
        }
Пример #3
0
        private void ISOV2_Click(object sender, EventArgs e)
        {
            string szTemp;

             listRet.Items.Clear();
             listRet.Items.Add("OpenDevice start...");

             uint nRet = m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);

             if (nRet == NBioAPI.Error.NONE)
             {
            NBioAPI.Type.HFIR hFIR, hAuditFIR;

            hAuditFIR = new NBioAPI.Type.HFIR();

            listRet.Items.Add("Enroll start...");

            m_NBioAPI.Capture(NBioAPI.Type.FIR_PURPOSE.VERIFY, out hFIR, NBioAPI.Type.TIMEOUT.DEFAULT, hAuditFIR, null);

            if (nRet == NBioAPI.Error.NONE)
            {
               NBioAPI.Export.EXPORT_AUDIT_DATA exportData;

               listRet.Items.Add("NBioBSPToImage start...");

               nRet = m_Export.NBioBSPToImage(hAuditFIR, out exportData);

               if (nRet == NBioAPI.Error.NONE)
               {
                  byte[] ISOBuf;

                  listRet.Items.Add("ExportRawToISOV2 start...");

                  nRet = NBioBSPISO4.ExportRawToISOV2((byte)NBioAPI.Type.FINGER_ID.LEFT_INDEX, (ushort)exportData.ImageWidth, (ushort)exportData.ImageHeight,
                                                      exportData.AuditData[0].Image[0].Data, false, NBioBSPISO4.COMPRESS_MOD.NONE, out ISOBuf);

                  if (nRet == NBioAPI.Error.NONE)
                  {
                     NBioBSPISO4.NIMPORTRAWSET ImportRawSet;

                     listRet.Items.Add("ImportISOToRaw start...");

                     nRet = NBioBSPISO4.ImportISOToRaw(ISOBuf, out ImportRawSet);

                     if (nRet == NBioAPI.Error.NONE)
                     {
                        listRet.Items.Add("Test result");

                        for (byte i = 0; i < ImportRawSet.nDataCount; i++)
                        {
                           szTemp = "DataLen: " + ImportRawSet.ImportRawData[i].RawData.Length;
                           listRet.Items.Add(szTemp);

                           szTemp = "FingerID: " + ImportRawSet.ImportRawData[i].nFingerID;
                           listRet.Items.Add(szTemp);

                           szTemp = "Image Width: " + ImportRawSet.ImportRawData[i].nImgWidth;
                           listRet.Items.Add(szTemp);

                           szTemp = "Image Height: " + ImportRawSet.ImportRawData[i].nImgHeight;
                           listRet.Items.Add(szTemp);
                        }
                     }
                     else
                     {
                        szTemp = "ImportISOToRaw Error: " + nRet;
                        listRet.Items.Add(szTemp);
                     }
                  }
                  else
                  {
                     szTemp = "ExportRawToISOV2 Error: " + nRet;
                     listRet.Items.Add(szTemp);
                  }
               }
               else
               {
                  szTemp = "NBioBSPToImage Error: " + nRet;
                  listRet.Items.Add(szTemp);
               }

               hFIR.Dispose();
               hAuditFIR.Dispose();
            }
            else
            {
               szTemp = "Capture Error: " + nRet;
               listRet.Items.Add(szTemp);
            }

            m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
             }
             else
             {
            szTemp = "CloseDevice Error: " + nRet;
            listRet.Items.Add(szTemp);
             }
        }
Пример #4
0
        private void ISOV1_Click(object sender, EventArgs e)
        {
            string szTemp;

            listRet.Items.Clear();
            listRet.Items.Add("OpenDevice start...");

            uint nRet = m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);

            if (nRet == NBioAPI.Error.NONE)
            {
                NBioAPI.Type.HFIR hFIR, hAuditFIR;

                hAuditFIR = new NBioAPI.Type.HFIR();

                listRet.Items.Add("Enroll start...");

                m_NBioAPI.Enroll(null, out hFIR, null, NBioAPI.Type.TIMEOUT.DEFAULT, hAuditFIR, null);

                if (nRet == NBioAPI.Error.NONE)
                {
                    NBioAPI.Export.EXPORT_AUDIT_DATA exportData;

                    listRet.Items.Add("NBioBSPToImage start...");

                    nRet = m_Export.NBioBSPToImage(hAuditFIR, out exportData);

                    if (nRet == NBioAPI.Error.NONE)
                    {
                        byte[] ISOBuf;

                        listRet.Items.Add("ExportRawToISOV1 start...");

                        nRet = NBioBSPISO4.ExportRawToISOV1(exportData, false, NBioBSPISO4.COMPRESS_MOD.NONE, out ISOBuf);

                        if (nRet == NBioAPI.Error.NONE)
                        {
                            NBioBSPISO4.NIMPORTRAWSET ImportRawSet;

                            listRet.Items.Add("ImportISOToRaw start...");

                            nRet = NBioBSPISO4.ImportISOToRaw(ISOBuf, out ImportRawSet);

                            if (nRet == NBioAPI.Error.NONE)
                            {
                                listRet.Items.Add("Test result");

                                for (byte i = 0; i < ImportRawSet.nDataCount; i++)
                                {
                                    szTemp = "DataLen: " + ImportRawSet.ImportRawData[i].RawData.Length;
                                    listRet.Items.Add(szTemp);

                                    szTemp = "FingerID: " + ImportRawSet.ImportRawData[i].nFingerID;
                                    listRet.Items.Add(szTemp);

                                    szTemp = "Image Width: " + ImportRawSet.ImportRawData[i].nImgWidth;
                                    listRet.Items.Add(szTemp);

                                    szTemp = "Image Height: " + ImportRawSet.ImportRawData[i].nImgHeight;
                                    listRet.Items.Add(szTemp);
                                }
                            }
                            else
                            {
                                szTemp = "ImportISOToRaw Error: " + nRet;
                                listRet.Items.Add(szTemp);
                            }
                        }
                        else
                        {
                            szTemp = "ExportRawToISOV1 Error: " + nRet;
                            listRet.Items.Add(szTemp);
                        }
                    }
                    else
                    {
                        szTemp = "NBioBSPToImage Error: " + nRet;
                        listRet.Items.Add(szTemp);
                    }

                    hFIR.Dispose();
                    hAuditFIR.Dispose();
                }
                else
                {
                    szTemp = "Enroll Error: " + nRet;
                    listRet.Items.Add(szTemp);
                }

                m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
            }
            else
            {
                szTemp = "CloseDevice Error: " + nRet;
                listRet.Items.Add(szTemp);
            }
        }