GetFingerSyntax: 
             int   GetFinger( INT DeviceNumber, BYTE* pRawImg, BYTE* pFeature )Return Value:
             FPAPIERR_OK , if successful
             Error code ( < 0 ), otherwiseParameters:
             DeviceNumber : device number which is co nnecte d on your PC.
             pRawImg : pointer to the buffer to store raw fingerprint image.
             pFeature : pointer to the buffer to store feature template.Re:
             Get the fingerprint image from the sensor and extract the feature template. At this time, buffers for fingerprint image and for feature template are previously allocated before calling this function. The size of buffer for image is 280X320 bytes and the minimum size of buffer for template is 480 bytes. The result of image quality checking is returned by result of this function, so you can use it to adjustment the application. Example:
             
Void CSDKTestView:: OnGetFinger()
{  
int cx = 280;   
int cy = 320;
int DeviceNumber = 0; // specify the first device  
BYTE* pImage = new BYTE[cx*cy], pVect[480];   
int result = GetFinger( DeviceNumber, pImage, pVect );   
if ( result != FPAPIERR_OK ){ 
     AfxMessageBox( “Process is failed!” ); 
  return;  
 }   …}----------------------------------------------------------------------
 
MatchFingerSyntax: 
             int   MatchFinger( BYTE* pFeatureVect1, 
                                          BYTE* pFeatureVect2,
                                          int securitylevel )Return Value:
             FPAPIERR_OK , if successful
             Error code ( < 0 ), otherwiseParameters:
             pFeatureVect1 : pointer to the sample fingerprint template.
             pFeatureVect2 : pointer to the query fingerprint template.
             securitylevel : security level value for fingerprint matching.
                                        This field has five values following to:
                         
value FAR FRR
HIGH_LEVEL 0.00001%< 5%<
HIGH_MEDIUM_LEVEL 0.00005%< 3%<
MEDIUM_LEVEL 0.0001%< 1%<
MEDIUM_LOW_LEVEL 0.001%< 0.5%<
LOW_LEVEL 0.01%< 0.1%<             
Re:
             Match two fingerprint template with the specified security level.Example:
             
Void CSDKTestView:: OnMatch(){   BYTE pVect1[480], pVect2[480];   …   if ( MatchFinger(&pVect1,&pVect2,MEDIUM_LEVEL) != FPAPIERR_OK ){      AfxMessageBox( “ Matching is failed! “ );      Return;   }   AfxMessageBox( “ Matching is OK! “ );   …} GetSortedIndexSyntax: 
             int   GetSortedIndex ( BYTE* pFeatureVect, 
                                         BYTE* pDatabaseVects,
Int nDatabaseSize,
Int* pIndex )Return Value:
            Get the sorted index which represents the order of matching in the database.Parameters:
             pFeatureVect : pointer to the query fingerprint feature template.
             pDatabaseVects : pointer to the fingerprint template list of the database.
             nDatabaseSize : number of  the fingerprint templates in the database.
             pIndex : pointer to the sorted index list.
             
Re:
             Get the pre-sorted index  which represents the order of matching in the database. Fingerprint matching is performed first entrie of the index  having global feature most similar to those of the query fingerprint image, then the next entries with most similar is matched, and so on, until the matching result is successful or the end of the database is reached. In most cases there is fairly good chance that the correct match will be found already in the beginning of the search. As a result, the number of matching required to achieve fingerprint identification decreases drastically, and correspondingly, the effective matching speed increases.Example:
                          
BOOL CMatchDlg::Match_1NMode(){ USERDATABASE pDataBase; int i; if ( GetAllUserInfo(&pDataBase) == FALSE ) return FALSE; // get the sorted database index list. int *pIndexArray = new int[pDataBase.nNumber]; BYTE *sampleVects; sampleVects = new BYTE*[pDataBase.nNumber*MAX_FEATUREVECT_LEN]; for ( i=0; i<pDataBase.nNumber; i++ ){         memcpy( &sampleVects[i*MAX_FEATUREVECT_LEN],                                   &(pDataBase.pUser[i].pFeatureVect),            MAX_FEATUREVECT_LEN); } GetSortedIndex(pUser.pFeatureVect, sampleVects,  pDataBase.nNumber, pIndexArray ); // match for index list. BOOL bMatch = FALSE; for ( i=0; i<pDataBase.nNumber; i++ ){ int idx = pIndexArray[i]; int res = MatchFinger(pDataBase.pUser[idx].pFeatureVect, pUser.pFeatureVect,m_nSecurityLevel); if ( res == FPAPIERR_OK ){ pUser.nUserID = pDataBase.pUser[idx].nUserID; bMatch = TRUE; break; } } delete sampleVects; delete pIndexArray; // return (bMatch);} CollectFeatureSyntax: 
             int   CollectFeature ( BYTE* pFeatureVect1, 
                                         BYTE* pFeatureVect2,
BYTE* pFeatureVect3,
BYTE* pCollectedFeatureVect )Return Value:
             Get the collected feature of 3 features.Parameters:
             pFeatureVect1 : pointer to the 1st fingerprint template.
             pFeatureVect2 : pointer to the 2nd fingerprint template.
             pFeatureVect3 : pointer to the 3rd fingerprint template.
             pCollectedFeatureVect : pointer to the collected fingerprint template.
             
Re:
             Get the collected feature of 3 features. These 3 features are analyzed and collected into a single feature collection, which is stored to the database. This way, the enrolled feature is more reliable and system performance considerably increases using this mode.Example:
             
void CEnrollDlg::OnTimer(UINT nIDEvent) { if ( m_nEnrollMode == DEFAULT_ENROLL ){ KillTimer(1); if ( CollectedEnroll() == FALSE ){ AfxMessageBox("User must press same finger 3 times !"); EndDialog(IDCANCEL); return; } … } else{ … } CDialog::OnTimer(nIDEvent);}BOOL CEnrollDlg::CollectedEnroll() { CWaitDlg dlg; BYTE pVect[3][MAX_FEATUREVECT_LEN]; int n = 0, res; while (1){ … res = GetFinger(0,pRawImage,pUser.pFeatureVect); if ( res != FPAPIERR_OK ) continue; // DrawRawImage(); memcpy(pVect[n],pUser.pFeatureVect,MAX_FEATUREVECT_LEN); // if (++n == 3) break; // … } // collect the features. if ( CollectFeature(pVect[0],pVect[1],pVect[2],pUser.pFeatureVect) !=1)     return FALSE; return TRUE;}
 DisplayImageSyntax: 
             int   DisplayImage ( HWND hWnd, 
                                         int x1, int y1, int x2, int y2,
BYTE* pImage, int nWidth, int nHeight )Return Value:
             Display the raw image data to window.Parameters:
             hWnd : handle to the window to draw.
             pImage : pointer to the raw image data.
             nWidth, nHeight : width and height of image data.
             x1,y1,x2,y2 : up-left, down-right (x,y) of window.
             
Re:
             Draw the raw image data to specified window.

解决方案 »

  1.   

    做指纹,不错!主要注意
    1 参数和返回值的类型对照
      INT => integer;
      BYTE * => PByte 或 PByteArray;
    2 传递指针前保证分配了内存C/C++ 的程序作为程序员(无论用什么语言),都应该能读懂,仔细读读吧
      

  2.   

    太长了吧!是不是从MSDN上摘下来得呀!
      

  3.   

    呜呜,就5个函数,我不知道在delphi中,怎么用,帮忙吧!
      

  4.   

    int   GetFinger( INT DeviceNumber, BYTE* pRawImg, BYTE* pFeature )
    delphi:
    function GetFinger(DeviceNumber:integer;pRawImg,pFeature :PByte;):integer;int   MatchFinger( BYTE* pFeatureVect1, 
                                              BYTE* pFeatureVect2,
                                              int securitylevel )
    delphi:
    function MatchFinger(pFeatureVect1,pFeatureVect2:PByte;securitylevel :integer):integer;都是大同小异的东西,你自己看着来吧
      

  5.   

    整理:
    GetFingerSyntax: 
                 int   GetFinger( INT DeviceNumber, BYTE* pRawImg, BYTE* pFeature )Return Value:
                 FPAPIERR_OK , if successful
                 Error code ( < 0 ), otherwiseParameters:
                 DeviceNumber : device number which is co nnecte d on your PC.
                 pRawImg : pointer to the buffer to store raw fingerprint image.
                 pFeature : pointer to the buffer to store feature template.Re:
                 Get the fingerprint image from the sensor and extract the feature template. At this time, buffers for fingerprint image and for feature template are previously allocated before calling this function. The size of buffer for image is 280X320 bytes and the minimum size of buffer for template is 480 bytes. The result of image quality checking is returned by result of this function, so you can use it to adjustment the application. Example:
                 
    Void CSDKTestView:: OnGetFinger()
    {  
    int cx = 280;   
    int cy = 320;
    int DeviceNumber = 0; // specify the first device  
    BYTE* pImage = new BYTE[cx*cy], pVect[480];   
    int result = GetFinger( DeviceNumber, pImage, pVect );   
    if ( result != FPAPIERR_OK ){ 
         AfxMessageBox( “Process is failed!” ); 
      return;  
     }   …}一个就行!都一样!
      

  6.   

    procedure OnGetFinger()
    var
      cx,cy: Integer;
      DeviceNumber: Integer;
      Image: PByte;
      Vect: Array [0..479] of Byte;
    begin
      cx := 280;
      cy := 320;
      DeviceNumber := 0;
      GetMem(Image,cx*cy);
      try
        if GetFinger(DeviceNumber,Image,@Vect[0]) <> FPAPIERR_OK) then
        begin
          ShowMessage('Process is failed!');
          Exit;
        end;
        // process image and vect here
      finally
        FreeMem(Image);
      end;
    end;
      

  7.   

    function GetFinger(DeviceNumber: Integer; RawImg: PByte; Feature: PByte):Integer;