Make Opencv 3.0 get error

asked 2017-02-10 01:59:14 -0600

Dear all, When run command "make" Opencv version 3.0 on Centos 6.5, I got these errors:

[100%] Built target opencv_perf_stitching
Traceback (most recent call last):
  File "/home/setup/opencv_source/opencv/modules/python/python2/..//src2/gen2.py", line 4,
    import hdr_parser, sys, re, os
  File "/home/setup/opencv_source/opencv/modules/python/src2/hdr_parser.py", line 855
    has_mat = len(list(filter(lambda x: x[0] in {"Mat", "vector_Mat"}, args))) > 0
                                                      ^
SyntaxError: invalid syntax
make[2]: *** [modules/python2/pyopencv_generated_include.h] Error 1
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
make: *** [all] Error 2

Please help me to fix this problem. Thank you.

edit retag flag offensive close merge delete

Comments

I don't know Centos but you should use last opencv version = 3.2.0

LBerger gravatar imageLBerger ( 2017-02-10 02:01:16 -0600 )edit

Thank you LBerger . I have pulled the latest source code of OpenCV from git. The problem is not solved :(.

More information: My environment: centos 6.8, python 2.6. I have installed success OpenCV 2.4 on this server, but my application need some new features from OpenCV 3, so I need to install it.

thanhnambkhn gravatar imagethanhnambkhn ( 2017-02-10 02:34:02 -0600 )edit

The error message is:

[ 99%] Building CXX object modules/calib3d/CMakeFiles/opencv_test_calib3d.dir/test/test_affine3.cpp.o
Traceback (most recent call last):
  File "/home/setup/opencv_source/opencv-3.2.0/modules/python/python2/..//src2/gen2.py", line 4, in <module>
    import hdr_parser, sys, re, os
  File "/home/setup/opencv_source/opencv-3.2.0/modules/python/src2/hdr_parser.py", line 855
    has_mat = len(list(filter(lambda x: x[0] in {"Mat", "vector_Mat"}, args))) > 0
                                                      ^
SyntaxError: invalid syntax
make[2]: *** [modules/python2/pyopencv_generated_include.h] Error 1
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
thanhnambkhn gravatar imagethanhnambkhn ( 2017-02-10 02:49:54 -0600 )edit
1

Sorry I cannot help you more. I think you cannot use Python 2.6 with opencv (windows need python version>2.7) see this post

LBerger gravatar imageLBerger ( 2017-02-10 02:50:17 -0600 )edit