Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在CentOS 5上构建OpenCV 2.0时遇到问题?_Opencv_Centos5 - Fatal编程技术网

在CentOS 5上构建OpenCV 2.0时遇到问题?

在CentOS 5上构建OpenCV 2.0时遇到问题?,opencv,centos5,Opencv,Centos5,我一直试图将OpenCV库安装到我的centos系统中,但在使用cmake配置后键入make并点击enter时,出现以下错误: [100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/amoments.o [100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/affine3d_estimator.o [100%] Building CXX object tes

我一直试图将OpenCV库安装到我的centos系统中,但在使用cmake配置后键入make并点击enter时,出现以下错误:

[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/amoments.o
[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/affine3d_estimator.o
[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/acontours.o
[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/areprojectImageTo3D.o
Linking CXX executable ../../bin/cvtest
CMakeFiles/cvtest.dir/src/highguitest.o: In function `CV_HighGuiTest::run(int)':
highguitest.cpp:(.text._ZN14CV_HighGuiTest3runEi+0x15): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
[100%] Built target cvtest
make: *** [all] Error 2
有趣的是,一旦我犯了这个错误:

[ 99%] Built target mltest
[ 99%] Generating generated0.i
Traceback (most recent call last):
  File "/home/proje/OpenCV-2.1.0/interfaces/python/gen.py", line 43, in ?
    if True in has_init and not all(has_init[has_init.index(True):]):
NameError: name 'all' is not defined
make[2]: *** [interfaces/python/generated0.i] Error 1
make[1]: *** [interfaces/python/CMakeFiles/cvpy.dir/all] Error 2
make: *** [all] Error 2

这些错误的原因可能是什么?我需要立即在此计算机上安装opencv

Python函数
all()
是在2.5版中引入的。您可能正在使用Python语言中尚不存在
all()
的版本进行编译

根据Python,
all()
相当于:

def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True
您可能还需要定义
any()
。它相当于:

def any(iterable):
    for element in iterable:
        if element:
            return True
    return False

但是,如果安装脚本需要Python 2.5,那么Python包装器的其余部分也很可能需要Python 2.5。

我遇到了这个问题。。这是Python接口。。。 默认情况下,Python 2.4安装在CentOS上,ot不容易升级到>2.6

当OpenCV构建时,它会被Python版本弄糊涂

因此,我已经在“cmake”上禁用了Python接口,一切正常

cmake-D cmake\u BUILD\u TYPE=RELEASE-D cmake\u INSTALL\u PREFIX=/usr/local-D BUILD\u NEW\u PYTHON\u SUPPORT=NO

但是,您当然不能再将OpenCV与Python一起使用了