Useful for python server side deployments that need computer vision.
I did this for a ubuntu 13.04 server. This should work for 12.10 without much of a problem.
Activate the virtualenv
For numpy and scipy it’s fairly simple
You can go by two approaches. One is to install opencv globally in your system and then moving those libraries to your virtualenv. This approach has some shortcomings. The globally installed opencv might have been compiled for a different version of python. It gets difficult during deployment to point to the right environment.
Copy globally installed opencv into your virtualenv
Use this incase you want to copy your system installed opencv over to your virtualenv. In the virtualenv you make for your project, do the following.
Copy cv.* (from OpenCV-2.2.0/lib directory) to the virtualenv site-packages
Again, I have seen this approach used only by an intern. I can’t vouch for it’s reliability.
The second approach mitigates some of those problems. Thanks to some helpful people on the web, I could figure out how to install OpenCV inside a virtualenv without touching the global python
Dependencies
For opencv, there are system dependencies which can be installed like so,
Download opencv, build it and install it
Downloading
Navigate to a folder to download opencv and download it
Installation
Testing if everything went right
Get into python shell and try the following commands
now inside the shell, try the following imports
these imports shouldn’t throw any error
Later, you might run into a decoder error. As a precaution, reinstall Pillow