python - opencv人脸识别: subspaceproject and subspacereconstruct methods in python

标签 python opencv face-recognition

我已经通过网络搜索,但到目前为止还没有找到以下问题的任何答案,因此我想在这里问问是否有人可以帮助我解决这个问题:

基本上我需要的与 PraveenofPersia/Jesse 那里的解决方案相同,但只有考虑 Fisherface 识别器的 python 实现: Any tips on confidence score for face verification (as opposed to face recognition)?

到目前为止,我面临的问题是 cv2 既不提供 subspaceProject 也不提供任何其他。

这里有什么建议吗?

谢谢!

最佳答案

不幸的是,默认情况下这些函数没有暴露给 python api。

如果您从源代码构建 cv2.pyd,有一个简单的补救措施:

  • 找到他们的代表。声明,opencv/modules/contrib/include/opencv2/contrib/contrib.hpp
  • CV_EXPORTS Mat subspaceProject(...) 更改为 CV_EXPORTS_W Mat subspaceProject(...)
  • CV_EXPORTS Mat subspaceReconstruct(...) 更改为 CV_EXPORTS_W Mat subspaceReconstruct(...)

  • 重新运行 cmake/make 以重建 cv 库和 python 包装器模块

额外的 _W 前缀会将这些函数添加到生成的包装器中

关于python - opencv人脸识别: subspaceproject and subspacereconstruct methods in python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19756176/

相关文章:

c++ - openCV 和 cvBlobs 没有给出与 matlab 相同的结果

Python - 值错误 : operands could not be broadcast together with shapes

python - 如何将多个模型的所有计算转移到 GPU

OpenCV GrabCut 算法示例不起作用

android - 如何使用 Clang 和最新的 NDK r15b 为 Android 构建 OpenCV

python - 如何以最佳方式调整我的面部识别常数(即阈值)?

c++ - OpenCV 人脸检测 ROI 断言失败

python - 使用numpy和cv2处理大型二进制图像数组

Python 64 位无法在 Windows HPC 上正确启动 (0xc00000cc)

python - SQLite实现的open/close函数