Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building OpenCV 2.3.1 with Python 2.7 support in Ubuntu 11.10 64bit

I have seen a lot of posts on this topic, however I have not found regarding this warning:

CMake Warning:
   Manually-specified variables were not used by the project:

   BUILD_PYTHON_SUPPORT

when I compile with cmake. When building OpenCV with this warning, it turns out that it doesn't include python support (surprise).

I use this command to compile the build-files

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..

I have installed python-dev.

like image 911
aagaard Avatar asked Dec 14 '11 20:12

aagaard


People also ask

Does Python 2.7 support OpenCV?

Figure 2: The output of CMake looks good — OpenCV 3.0 will compile with Python 2.7 bindings using the Python interpreter and NumPy package associated with our virtual environment.

What does the command sudo apt get install OpenCV do?

It is used for a very wide range of applications, including medical image analysis, stitching street view images, surveillance video, detecting and recognizing faces, tracking moving objects, extracting 3D models, and much more.


1 Answers

It looks like you're using an old install guide. Use BUILD_NEW_PYTHON_SUPPORT instead.

So, execute CMake like this:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..

Also, if you use the CMake GUI, it is easier to see all of the options you can set for OpenCV (there are so many it's quite tedious to type them all on the command-line). To get it for Ubuntu, do this:

sudo apt-get install cmake-qt-gui
like image 117
mevatron Avatar answered Sep 21 '22 01:09

mevatron