富翁们救救我,谁能提供用FDA01 脱机指纹识别模块开发的指纹验证例子。(在线等候) (150分)

  • 主题发起人 主题发起人 decade
  • 开始时间 开始时间
D

decade

Unregistered / Unconfirmed
GUEST, unregistred user!
富翁们救救我,谁能提供用FDA01 脱机指纹识别模块开发的指纹验证例子。
由于开发包仅提供类似于
DWORD WINAPI OpenDevice(char* port, DWORD speed)
Initializes the specified communication port and connect device.
n Parameters
port
communication port (COM1, COM2)
speed
communication speed (9600 - 57600)
n Return values
M2ERROR_NONE = No error
M2ERROR_FUNCTION_FAIL = Invalid speed
的一些API函数(我还不知道在delphi里怎么调用呢。)
和一些dll,唯一的例子也由陌生c++写出来,我真的无法可施。
请大富翁们给个由delphi写的相关代码,看看,不胜感激!
 
我用过veridicom的指纹识别仪, 手里有现成的一套指纹考勤系统的源代码
由于硬件不同, 可能对你用处不大, 不过还是贴出来吧:
unit VFSI;
interface
uses
Windows, SysUtils , Classes, Graphics, Dialogs ,StdCtrls ,ExtCtrls ,DbTables,
DbClient, DB ;
type
TDoublePChar=array [1..300] of PChar;
const
UsbPara=True;
//True:USB;
False:Paralla
DLLPATH='';
//must repare 'DLL/'
BMPPATH:string='BMP/';
bmpnum:integer=0;
VFPS_STANDARD=2;
VFPS_IMAGEPLUS=4;
VFPS_NOCALIBRATE=32;
//Note:VFPS_*变量组在../dll/VFPSImg.h中描叙
VFPS_AUTO_MAX=0;
VFPS_NO_DMA=16;
VFPS_NO_ECP=32;
VFPS_FORCE=64;
V_USB_TYPE=0;
V_PPORT_TYPE=1;
var
FingerPosition:integer;
bmpfilename:array[0..79] of Char;
minfilename:array[0..79] of Char;
BitMap : TBitMap;
fpreadimg,fpwriteimg:array[1..90000]of char;
fpsearchminu,fpenrollminu:array[1..256*20]of char;
pstr,pstr2:PChar;
fpnumminus:longint;
//fpfltr function
fprows,fpcols,fpmode,fpflags:integer;
//VFPSinitialize function
//This functions are Low Lever Software Module
do
opensensor,doclosesensor,doresetdevice:longint;
do
setdevicemode,dogetdevicemode:longint;
//This variables are Image Capture Module function's return.
do
vfpsinitialize:longint;
do
vfpsgetimage,dovfpsclose:integer;
//This functions are Verification Suite Modules
do
fpfltrinit,dofpfltr:longint;
//fpfltr.dll
do
matchprints,doinitmatcher:longint;
//vmatcher.dll
do
readuncompressedminufile,dowriteuncompressedminufile:Longint;
//vmatcher.dll
//This functions are Low Lever Software Module
//of USB'dll in ../dll/vfps100a.dll.
//Note:All functions are _cdecl type in this module.
function openSensor(sensorID:longint):longint;
cdecl;external DLLPATH+'vfps100p.dll';
//add 'p' if use paralla sensor
function closeSensor(sensorHandle:longint):longint;
cdecl;external DLLPATH+'vfps100p.dll';
function resetDevice(sensorHandle:longint):longint;
cdecl;external DLLPATH+'vfps100p.dll';
function setDeviceMode(sensorHandle:longint;mode:longint):longint;
cdecl;external DLLPATH+'vfps100p.dll';
function getDeviceMode(sensorHandle:longint):longint;
cdecl;external DLLPATH+'vfps100p.dll';
//This functions are Image Capture Module
// of USB'dll in ../dll/vfpsimg.dll.
//Note:All functions are _stdcall type in this module.
function VFPSinit(sensorid:integer;
var numrows: integer;var numcolumns:integer;
var mode:integer;configure:PChar;flags:integer):longint;
stdcall;external DLLPATH+'vfpsimg.dll';
//add 'p' if use paralla sensor
function VFPSselectSensor(sensorType,overrides:Longint):Longint;
stdcall;external DLLPATH+'vfpsimg.dll';
//add 'p' if use paralla sensor
function VFPSinitialize(sensorid:integer;
var numrows: integer;var numcolumns:integer;
var mode:integer;configure:PChar;flags:integer):longint;
stdcall;external DLLPATH+'vfpsimg.dll';
//add 'p' if use paralla sensor
function VFPSgetImage(handle:longint;mode:integer;imagedata:PChar;flags:integer):integer;
stdcall;external DLLPATH+'vfpsimg.dll';
function VFPSclose(fhandle:longint;flags:integer):integer;
stdcall;external DLLPATH+'vfpsimg.dll';
//This functions are Verification Suite Modules
//of USB'dll in ../dll/fpfltr5.dll or vmatcher.dll or minulib.dll.
//Note:All functions are _stdcall type in that modules.
//This functions in ../dll/fpfltr5.dll
function fpfltrinit(configfile:PChar):longint;
stdcall;external DLLPATH+'fpfltr5';
function fpfltr(imagein:TDoublePChar;height,width:longint;minutiae:PChar;
var nminutiae:longint;imageout:TDoublePChar;dflag:integer):longint;
stdcall;external DLLPATH+'fpfltr5.dll';
//This functions in ../dll/vmatcher.dll
function initMatcher(configfile:PChar):longint;
stdcall;external DLLPATH+'vmatcher.dll';
function matchprints(serachminu:Pchar;nsearchminu:longint;fileminu:pchar;nfileminu:longint):longint;
stdcall;external DLLPATH+'vmatcher.dll';
//This functions in ../dll/minulib.dll
function readUncompressedMinuFile(minufile:pchar;minudata:pchar):integer;
stdcall;external DLLPATH+'minulib.dll';
function writeUncompressedMinuFile(minufile:PChar;minudata:Pchar;numMinu:integer):integer;
stdcall;external DLLPATH+'minulib.dll';
function initQuality(configFile:PChar):longint;
stdcall;external DLLPATH+'kyqual.dll';
function Quality(inImage:PChar;height:longint;width:longint):integer;
stdcall;external DLLPATH+'kyqual.dll';
Procedure fpsensorinit(vfpmode:integer);
//底层函数,未用
Procedure fpclosesensor;
//底层函数,未用
Function vfpinit:boolean;
Procedure vfpclose;
procedure vfpgrasp (sImage1: TImage);
function vfpgandc (DoTimer:TTimer;PassTable:TQuery):boolean;
procedure CompareNewOld(TClers:TDBDataSet;tmpfilename,bmpno:String;bmpsize:Integer);
procedure WriteFileToBlob(PassTable:TTable;FileName,BmpNo:String);
implementation
Procedure fpsensorinit(Vfpmode:integer);
begin
do
opensensor:=OpenSensor(0);
if do
opensensor>=0 then
showmessage('传感器打开成功!')
else
showmessage('传感器打开失败!');
do
resetdevice:=ResetDevice(doopensensor);
if do
resetdevice=0 then
showmessage('传感器重置成功!')
else
showmessage('传感器重置失败!');
do
setdevicemode:=SetDeviceMode(doopensensor,vfpmode);
if do
setdevicemode=0 then
showmessage('传感器模式设置成功!')
else
showmessage('传感器模式设置失败!');
end;

Procedure fpclosesensor;
begin
do
closesensor:=closesensor(doopensensor);
if do
closesensor=0 then
showmessage('传感器关闭成功!')
else
showmessage('传感器关闭失败!');
end;

Procedure vfpclose;
begin
do
vfpsclose:=VFPSclose(dovfpsinitialize,fpflags);
if do
vfpsclose>=0 then
else
begin
showmessage('传感器图象采集关闭失败!');
exit;
end;
end;

Function vfpinit:boolean;
begin
if UsbPara then
fpflags:=VFPS_STANDARD
else
fpflags:=VFPS_AUTO_MAX;
fpmode:=0;
if not UsbPara then
VFPSselectSensor(V_PPORT_TYPE,0);
do
vfpsinitialize:= VFPSinitialize(0, fprows, fpcols, fpmode, nil,fpflags);
do
fpfltrinit:=fpfltrinit(DLLPATH+'fpfltr.cfg');
if (dovfpsinitialize>=0) and (dofpfltrinit=0) then
vfpinit:=True
else
begin
showmessage('传感器图象采集初始化失败!');
vfpinit:=False;
exit;
end;
initQuality(DLLPATH+'quality.cfg');
end;

procedure vfpgrasp (sImage1: TImage);
var
x,y : integer;
P : PByteArray;
pstr1,pstr3:TDoublePChar;
begin
pstr:=@fpreadimg;
if UsbPara then
fpflags:=VFPS_STANDARD
else
fpflags:=VFPS_AUTO_MAX;
fpmode:=0;
do
vfpsgetimage:= VFPSgetImage(dovfpsinitialize,fpmode,pstr,fpflags );
FingerPosition:=Quality(pstr,fprows,fpcols);
if do
vfpsgetimage<0 then
begin
ShowMessage('传感器图象采集失败!');
Exit;
end;
try
BitMap := TBitMap.create;
BitMap.LoadFromFile(BMPPATH+'plate.bmp');
for y := 0 to BitMap.height -1 do
begin
P := BitMap.ScanLine[y];
for x := 0 to BitMap.width -1 do
P[x] := Ord(fpreadimg[y*300+x+1]);
end;
SImage1.canvas.draw(0,0,BitMap);
for x:=1 to 300 do
begin
pstr1[x]:=@fpreadimg[(x-1)*300+1];
pstr3[x]:=@fpwriteimg[(x-1)*300+1];
end;
pstr2:=@fpsearchMinu;
do
fpfltr:=fpfltr(pstr1, 300, 300, pstr2, fpnumMinus, pstr3, 0);
finally
end;
end;

procedure WriteFileToBlob(PassTable:TTable;FileName,BmpNo:String);
var
FStream:TFileStream;
BStream:TStream;
f: file of Byte;
size : Longint;
begin
AssignFile(f,FileName);
Reset(f);
size := FileSize(f);
CloseFile(f);
if PassTable.FieldByName('zhiwen'+BmpNo+'bmp').IsBlob then
begin
PassTable.DisableControls;
PassTable.Edit;
FStream:=TFileStream.Create(FileName,fmOpenRead);
BStream:=PassTable.CreateBlobStream(PassTable.FieldByName('zhiwen'+BmpNo+'bmp'),bmWrite);
try
BStream.CopyFrom(FStream,FStream.Size);
PassTable.FieldByName('zhiwen'+BmpNo).AsInteger:=size;
PassTable.FieldByName('zhiwenshu').Asinteger:=
PassTable.FieldByName('zhiwenshu').Asinteger+1;
PassTable.Post;
PassTable.Refresh;
finally
FStream.Free;
end;
PassTable.EnableControls;
end;
end;

procedure CompareNewOld(TClers:TDBDataSet;tmpfilename,bmpno:String;bmpsize:Integer);
var
FStream:TFileStream;
BStream:TStream;
f: file of Byte;
size : Longint;
begin
if FileExists(tmpfilename) then
begin
AssignFile(f, tmpfilename);
Reset(f);
size := FileSize(f);
CloseFile(f);
if size = bmpsize then
Exit;
end;
if TClers.FieldByName('zhiwen'+bmpno+'bmp').IsBlob then
begin
FStream:=TFileStream.Create(tmpfilename,fmCreate);
BStream:=TClers.CreateBlobStream(TClers.FieldByName('zhiwen'+bmpno+'bmp'),bmRead);
try
FStream.CopyFrom(BStream,BStream.Size);
finally
FStream.Free;
BStream.Free;
end;
end;
end;

function vfpgandc (DoTimer:TTimer;PassTable:TQuery):boolean;
var
x : integer;
pstr1,pstr3:TDoublePChar;
tmpfilename:string[80];
gerenzhiwen:integer;
begin
vfpgandc:=False;
pstr:=@fpreadimg;
if UsbPara then
fpflags:=VFPS_STANDARD
else
fpflags:=VFPS_AUTO_MAX;
fpmode:=0;
if VFPSgetImage(dovfpsinitialize,fpmode,pstr,fpflags )<0 then
Exit;
for x:=1 to 300 do
begin
pstr1[x]:=@fpreadimg[(x-1)*300+1];
pstr3[x]:=@fpwriteimg[(x-1)*300+1];
end;
pstr2:=@fpsearchMinu;
do
fpfltr:=fpfltr(pstr1, 300, 300, pstr2, fpnumMinus, pstr3, 0);
if (fpnumMinus>20) then
vfpgandc:=True else
Exit;
if PassTable=nil then
Exit;
//this is very important.
do
Timer.Enabled:=False;
PassTable.First;
While not PassTable.EOF do
begin
gerenzhiwen:=PassTable.fieldbyname('zhiwenshu').AsInteger-1;
for x:=0 to gerenzhiwen do
begin
tmpfilename:=BMPPATH+'T';
tmpfilename:=Concat(tmpfilename,PassTable.FieldByName('No').AsString,IntToStr(x),'.min');
// CompareNewOld(PassTable,tmpfilename,IntToStr(x),
// PassTable.FieldByName('zhiwen'+IntToStr(x)).AsInteger);
StrPCopy(minfilename,tmpfilename);
pstr:=@fpenrollMinu;
do
readUncompressedMinuFile:=readUncompressedMinuFile(minfilename, pstr);
if do
readUncompressedMinuFile < 0 then
Continue;
do
matchprints:=matchprints(pstr,doreadUncompressedMinuFile, pstr2, fpnumMinus);
if do
matchprints > 0 then
begin
vfpgandc:=True;
Exit;
end;
end;
PassTable.Next;
end;
vfpgandc:=False;
end;

end.

 
请问htw:
这个
DWORD WINAPI OpenDevice(char* port, DWORD speed)
是Api函数吗?我在ShellApi里找不到它,也不知它是否是dll里的一个函数。
请指点迷津!
 
htw 你好,能把你考勤系统的源代码给我一份吗?
我对排班什么的搞的头都大了。
如果肯把源码给我看看,我愿意给你所有的分!
如果不方便,给我看看文档好吗?
我都不知道怎么入手作。
好迷茫啊。
大虾能帮忙吗?
Noth_Wind@163.com
qq:40501695
 
该死的sdk,提供一个没用的例子。指纹验证模块,竟然不提供指纹验证例子,下次决对
不买他的产品,还请富翁们帮帮忙,给个例子看看。
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
796
import
I
I
回复
0
查看
666
import
I
后退
顶部