我真的需要你的帮助。我尝试使用Cython访问opencv描述符AKAZE和FREAK与Python(直到现在,我只是用FREAK尝试过)。但是每次我尝试编译它时,我都会收到一条错误的信息,大约730行,因为Cython说它不知道vector & lt;…& gt;类型,有些行不在HPP文件中的官方C++语法中。但我不明白这一点,因为它是官方的opencv头文件。在
这是我的错误消息的一部分:
/usr/include/opencv2/features2d/features2d.hpp:1515:35: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
/usr/include/opencv2/features2d/features2d.hpp:1515:41: error: expected ‘,’ or ‘...’ before ‘<’ token
CV_EXPORTS float getRecall( const vector<Point2f>& recallPrecisionCurve, float l_precision );
^
/usr/include/opencv2/features2d/features2d.hpp:1516:39: error: ‘vector’ does not name a type
CV_EXPORTS int getNearestPoint( const vector<Point2f>& recallPrecisionCurve, float l_precision );
这是我的.pxd文件:
^{pr2}$这是我的设置.py文件:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
libdir = ["/usr/include/", "/usr/local/lib"]
incdir = ["/usr/local/lib/", "/usr/include", "/usr/include/opencv2/core"]
ext_modules = [Extension("description",
["description.pyx"],
language="c++",
library_dirs=libdir,
include_dirs=incdir,
libraries=["opencv_features2d", "opencv_core"])]
setup(name="description", ext_modules=cythonize(ext_modules))
错误消息几乎为每个函数抛出错误(我只想访问FREAK构造函数)。希望你能帮助我。在
非常感谢, 利奥
目前没有回答
相关问题 更多 >
编程相关推荐