python - TypeError: Can't display face landmarks with OpenCV using camera
问题描述
当我突然收到此错误时,我正在关注 OpenCV 的教程:
TypeError: __call__(): incompatible function arguments. The following argument types are supported:
1. (self: _dlib_pybind11.shape_predictor, image: array, box: _dlib_pybind11.rectangle) -> _dlib_pybind11.full_object_detection
我试图使用 module.py 中的代码来绘制这个面部标志:
predictor = dlib.shape_predictor("Predictor/shape_predictor_68_face_landmarks.dat")
def faceLandmarkDetector(image, gray, face, Draw=True):
landmarks = predictor(gray, face)
pointList = []
for n in range(0, 68):
point = (landmarks.part(n).x, landmarks.part(n).y)
pointList.append(point)
if Draw == True:
cv.circle(image, point, 3, ORANGE, 1)
return image, pointList
我在 main.py 上使用此代码调用它:
image, PointList = m.faceLandmarkDetector(frame, grayFrame, face)
我不知道这个错误是什么意思,我试图查看我的参数,但我无法识别我的错误。我需要一些帮助,我已经尝试了一些解决类似问题的方法,但它们不起作用。我的相机很好,我检查了我的模块版本。
我遵循的教程在这里,在 12 分钟标记处是我开始遇到问题的地方。
解决方案
推荐阅读
- javascript - 我想念什么意图?
- php - 提交表格帮助(IIS 网页)
- python - SQL炼金术 | 如何仅查询和过滤非 Null(或 None)的变量?
- laravel - 我如何将加入某事添加到我的 url (segemnt 1)
- amazon-web-services - 使用 AWS 云开发工具包 (CDK) 进行本地测试
- javascript - 使用 Object.keys Angular 获取 json 中的键和值
- c++ - 我怎样才能让我的蛇的身体扩大?
- python - 检查变量是 NaN 还是 Pandas 数据框中的 None
- java - IntelliJ HelloWorld Gradle 项目因 MultipleCompilationErrorsException 而失败
- c# - 刷新 CarouselView 项目后保持当前位置