2004/Nov/26

this code just for test matching system

isag16:~/workspace/scanner# ./testmatch
VFInitialize returns 0
selected scanner: AFS 4000, dpi: 250, init returns: 0
press your finger on fingerprint scanner 1st
press your finger on fingerprint scanner 2nd
test before1
test after1

test before1
test after1

same finger. Similarity: 603
isag16:~/workspace/scanner#

isag16:~/workspace/scanner# ./testmatch
VFInitialize returns 0
selected scanner: AFS 4000, dpi: 250, init returns: 0
press your finger on fingerprint scanner 1st
press your finger on fingerprint scanner 2nd
test before1
test after1

test before1
test after1

Different fingers. Sililarity: 0
isag16:~/workspace/scanner#


#include <stdlib.h>
#include <stdio.h>
#include <scanner.h>
#include <VFinger.h>

struct scanner_info* scanner = &scanner_AFS4000;
void do_extraction (unsigned char *fileName, BYTE* features,int w , int h, int dpi)
{
DWORD features_size = 0;
int ret = 0;
printf("test before1\n");
ret = VFExtract (w, h, (BYTE *) fileName, dpi, features, &features_size, 0);
printf("test after1\n");
if (ret != VFE_OK)
{
if (ret == VFE_LOW_QUALITY_IMAGE)
{
printf ("WARNING: Image1 is low quality.\n");
}
else
{
printf ("An error1 occured. Exiting %d.\n",ret);
exit (1);
}
}
printf ("\n");
}
int main (void)
{
int ret;
int i = scanner -> init();
int dpi = scanner -> dpi;
char *name = scanner -> name;
int w1, w2, h2, h1;
char *image1 , *image2;
ret = VFInitialize();
fprintf(stdout,"VFInitialize returns %d \n",ret);
if (i){
fprintf(stderr,"scanner init error");
return 1;
}
fprintf(stdout,"selected scanner: %s, dpi: %d, init returns: %d\n",name ,dpi, i);
fprintf(stdout,"press your finger on fingerprint scanner 1st \n");
do
{
image1 = scanner -> read(&w1, &h1);
}while(image1 == NULL);

fprintf(stdout,"press your finger on fingerprint scanner 2nd \n");
do
{
image2 = scanner -> read(&w2,&h2);
}while(image2 == NULL);

//fprintf(stdout,"image1 = %s \n",image1);
//fprintf(stdout,"image2 = %s \n",image2);
/* Verification */

BYTE features1[VF_MAX_FEATURES_SIZE], features2[VF_MAX_FEATURES_SIZE];
VFMatchDetails md;
BOOL result;


md.Size = sizeof(md);


do_extraction (image1, features1, w1, h1, dpi);
do_extraction (image2, features2, w2, h2, dpi);


result = VFSucceeded(VFVerify(features1, features2, &md, NULL));
if( result )
fprintf(stdout,"same finger. Similarity: %d", md.Similarity);
else
fprintf(stdout,"Different fingers. Sililarity: %d", md.Similarity);


scanner -> close();
VFFinalize();
return 0;
}

so next thing that i should do is about how to set threshold

Comment

Comment:

Tweet


hi all !!
#8 by sears parts (124.157.191.197) At 2009-12-04 09:28,
ขอบคุณค่ะ
#7 by โหลดเพลง (124.157.236.176) At 2009-10-06 18:17,
Que
#6 by sera (124.157.236.176) At 2009-10-03 17:10,
ดีๆ
#5 by ดีๆ (124.157.236.229) At 2009-09-22 06:04,
ขอบคุณจ้า
#4 by parts (124.157.236.229) At 2009-09-21 07:12,
ขอบคุณจ้า
#3 by ดาวโหลดเพลง (124.157.236.219) At 2009-09-09 12:13,
The way you look tonigh. Dayaram Thurayya.
#2 by Dayaram Thurayya (208.184.65.78) At 2007-08-28 14:29,
Google is the best search engine
#1 by RtoRsfebK (85.255.114.134) At 2007-03-02 18:17,