2017-02-28 111 views
0

我正在使用的链接中提到的代码:我使用opencv3和DLIB执行它蟒蛇Python3.5OpenCV的和DLIB人脸检测

OpenCV detect face landmarks (ear-chin-ear line)

,但我得到了以下错误:

rect=dlib.rectangle(x,y,x+w,y+h) which is Boost.Python.ArgumentError: Python argument types in rectangle.__init__(rectangle, numpy.int32, numpy.int32, numpy.int32, numpy.int32) did not match C++ signature: __init__(_object*, long left, long top, long right, long bottom) __init__(_object*) 

x,y,w,h =rects[0].astype('long') 

我使用改变的参数的类型但同样的错误依然存在。请帮助。

回答

1

Dlib附带完整的示例程序,显示如何执行此操作。您应该参考该代码,因为它是正确的:http://dlib.net/face_recognition.py.html

此外,这里还有其他python示例程序。他们都正确运行:https://github.com/davisking/dlib/tree/master/python_examples

+0

我所指的代码是最常用的代码之一,我得到的错误是,dlib需要long类型的参数,所以即使在类型转换后,我得到相同的错误。所以我只是想调试它,也许你可以帮忙。 –

+0

如果它甚至不起作用,它怎么会是'最常用的代码'? –

+0

但是必须有一些方法才能使代码正常工作......只是很想解决Python 3和dlib。 –