到目前为止,我已经实现了类似的测试函数
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%xn", 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%xn", 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用于面部特征验证,请提前告诉我,非常感谢。
我找到了路。
https://www.codeproject.com/Articles/1156801/FingerPrintf-A-small-library-for-quick-usage-of-th
您必须以异步模式打开框架,调用WinBioMonitorPresence,然后在消息循环中接收WINBIO_Async_RESULT,才能查看相机的状态。