到目前为止,我已经实现了一个这样的测试函数
hr = WinBioEnumBiometricUnits(
WINBIO_TYPE_FACIAL_FEATURES, // Type of biometric unit
&unitSchema, // Array of unit schemas
&unitCount); // Count of unit schemas
if (FAILED(hr))
{
wprintf_s(L"\n WinBioEnumBiometricUnits failed. hr = 0x%x\n", hr);
goto e_Exit;
}
hr = WinBioOpenSession(
WINBIO_TYPE_FACIAL_FEATURES, // Service provider
WINBIO_POOL_SYSTEM, // Pool type
WINBIO_FLAG_DEFAULT, // Configuration and access
NULL, // Array of biometric unit IDs
0, // Count of biometric unit IDs
WINBIO_DB_DEFAULT, // Database ID
&sessionHandle // [out] Session handle
);
if (FAILED(hr))
{
wprintf_s(L"\n WinBioOpenSession failed. hr = 0x%x\n", hr);
goto e_Exit;
}
retry:
// Locate the biometric sensor and retrieve a WINBIO_IDENTITY object.
wprintf_s(L"\n Calling WinBioIdentify - Swipe finger on sensor...\n");
hr = WinBioIdentify(
sessionHandle, // Session handle
&unitId, // Biometric unit ID
&identity, // User SID
&subFactor, // Finger sub factor
&rejectDetail // Rejection information
);
我在windows10笔记本电脑上测试了它,上面有一个摄像头,我可以通过windows的面部功能登录操作系统Hello,WinBioEnumBiometricUnits
成功,计数是1,WinBioOpenSession
也成功,但WinBioIdentify
失败,错误代码是WINBIO_E_INVALID_OPERATION-0x8009802C
,MSDN说windows生物识别框架只支持WINBIO_TYPE_FINGERPRINT
,文档最后一次更新是在2018年,已经三年了,有没有朋友知道MS是否支持WINBIO_TYPE_FACIAL_FEATURES
类型,或者可能有其他的人脸特征验证API,请告诉我,非常感谢。
1条答案
按热度按时间azpvetkf1#
我找到路了
https://www.codeproject.com/Articles/1156801/FingerPrintf-A-small-library-for-quick-usage-of-th
您必须在异步模式下打开框架,调用WinBioMonitorPresence,然后在消息循环中接收WINBIO_ASYNC_RESULT,以查看相机的状态。