问题描述
- 虹膜识别出现错误识别,识别成其他人的问题 10C
- void CTestBioDlg::OnBTNBioIDMatch()
{
// TODO: Add your control notification handler code here
// 数组初始化,用于保存员工编号
m_strArrayWorkerNo.RemoveAll();
// read
try
{
//打开数据库操作
CString strSQL = ""select * from mwsswork"";
m_useBLOB.Open(CRecordset::snapshot strSQL);
if(m_useBLOB.IsOpen())
{
//将记录逐条读进缓存区
m_useBLOB.MoveFirst();
CString strFileName = _T(""c:Iris.txt"");
CString strText = _T("""");
CFile outFile(strFileName CFile::modeCreate|CFile::modeWrite);
//员工总人数
IrisDatabaseSize =0;
while (!m_useBLOB.IsEOF())
{
//统计员工总人数
IrisDatabaseSize++;
//员工编号写进数组
strText = m_useBLOB.m_workerno;
//除去字符串右边的字符
strText.TrimRight(_T("" ""));
m_strArrayWorkerNo.Add(strText);
//分配内存区,并将虹膜信息逐条写进c:Iris.txt
LPSTR buffer = (LPSTR)GlobalLock(m_useBLOB.m_workerpicture.m_hData);
outFile.WriteHuge(bufferm_useBLOB.m_workerpicture.m_dwDataLength);
GlobalUnlock(m_useBLOB.m_workerpicture.m_hData);
//读取下一条记录
m_useBLOB.MoveNext();
}outFile.Close();
}m_useBLOB.Close();
}
catch(CException* pE)
{
pE->ReportError();
pE->Delete();
return;
}
//分配缓存区
CFile FileIris(""c:Iris.txt""CFile::modeRead);
DWORD Length = FileIris.GetLength();
//指向缓存区的指针P
p=::GlobalAlloc(0Length);if(p==NULL){ this->MessageBox(""分配缓冲区出错"");}FileIris.ReadHuge(pLength);long* IrisTemplatesDatabase;//m_dlgsyssetting系统参数设置对话框 算法设置CString ComboAlgorithm = m_dlgsyssetting.m_strComboAlgorithm;//数据格式转换long ISOIEC197946Segment = _ttol(ComboAlgorithm);m_ctrlBIO.BioIDSetISOIEC197946Segment(ISOIEC197946Segment);//识别间隔时间 m_dlgsyssetting系统参数设置对话框CString EditTime = m_dlgsyssetting.m_strEditTime;//数据格式转换long Sleep = _ttol(EditTime);//识别模式 Mode=0为一对一识别long Mode = 0;if (m_dlgsyssetting.m_strCheckMatch == ""TRUE""){ Mode = 1; }//指针类型转换 void far *p 转换为 (long*)(p)IrisTemplatesDatabase = (long*)(p);//调用虹膜识别函数//BioIDMatchIris(long*IrisTemplatesDatabaselong IrisDatabaseSizelong Modelong Sleep)//通过调用控件对应的虹膜识别函数来实现虹膜识别的功能m_ctrlBIO.BioIDMatchIris(IrisTemplatesDatabaseIrisDatabaseSize ModeSleep);
}
我这边现在可以判断的是采集的虹膜信息是没问题的,我把从数据库里面读出来的虹膜信息替换了厂家提供的软件下根目录里的采集的虹膜特征文件,这个时候可以正常识别的。
下面这个是识别函数对应的消息事件响应
void CTestBioDlg::BioIDMatchIrisEvent(long RecordID long MatchResult)
{
// TODO: Add your control notification handler code here
if (MatchResult == 1)
{CString strMsg; //匹配员工编号 matchID = m_strArrayWorkerNo[RecordID]; strMsg = ""员工工号为【"" + matchID + ""】识别成功!""; MessageBox(strMsg提示"" MB_ICONINFORMATION | MB_OK); ::GlobalFree(p); m_bDialogMode = TRUE; // int nResponse = m_dlgexam.DoModal(); m_dlgexam.DoModal();}
}
已经困扰了很久,求大神帮忙解答
解决方案
http://download.csdn.net/detail/puyun0902/1342916
时间: 2024-11-02 04:11:08