c++ 如何通过winbio API验证人脸特征?

dphi5xsq  于 2023-06-25  发布在  其他
关注(0)|答案(1)|浏览(161)

到目前为止,我已经实现了一个这样的测试函数

  1. hr = WinBioEnumBiometricUnits(
  2. WINBIO_TYPE_FACIAL_FEATURES, // Type of biometric unit
  3. &unitSchema, // Array of unit schemas
  4. &unitCount); // Count of unit schemas
  5. if (FAILED(hr))
  6. {
  7. wprintf_s(L"\n WinBioEnumBiometricUnits failed. hr = 0x%x\n", hr);
  8. goto e_Exit;
  9. }
  10. hr = WinBioOpenSession(
  11. WINBIO_TYPE_FACIAL_FEATURES, // Service provider
  12. WINBIO_POOL_SYSTEM, // Pool type
  13. WINBIO_FLAG_DEFAULT, // Configuration and access
  14. NULL, // Array of biometric unit IDs
  15. 0, // Count of biometric unit IDs
  16. WINBIO_DB_DEFAULT, // Database ID
  17. &sessionHandle // [out] Session handle
  18. );
  19. if (FAILED(hr))
  20. {
  21. wprintf_s(L"\n WinBioOpenSession failed. hr = 0x%x\n", hr);
  22. goto e_Exit;
  23. }
  24. retry:
  25. // Locate the biometric sensor and retrieve a WINBIO_IDENTITY object.
  26. wprintf_s(L"\n Calling WinBioIdentify - Swipe finger on sensor...\n");
  27. hr = WinBioIdentify(
  28. sessionHandle, // Session handle
  29. &unitId, // Biometric unit ID
  30. &identity, // User SID
  31. &subFactor, // Finger sub factor
  32. &rejectDetail // Rejection information
  33. );

我在windows10笔记本电脑上测试了它,上面有一个摄像头,我可以通过windows的面部功能登录操作系统Hello,WinBioEnumBiometricUnits成功,计数是1,WinBioOpenSession也成功,但WinBioIdentify失败,错误代码是WINBIO_E_INVALID_OPERATION-0x8009802C,MSDN说windows生物识别框架只支持WINBIO_TYPE_FINGERPRINT,文档最后一次更新是在2018年,已经三年了,有没有朋友知道MS是否支持WINBIO_TYPE_FACIAL_FEATURES类型,或者可能有其他的人脸特征验证API,请告诉我,非常感谢。

azpvetkf

azpvetkf1#

我找到路了
https://www.codeproject.com/Articles/1156801/FingerPrintf-A-small-library-for-quick-usage-of-th
您必须在异步模式下打开框架,调用WinBioMonitorPresence,然后在消息循环中接收WINBIO_ASYNC_RESULT,以查看相机的状态。

相关问题