Installation of OpenCV 3.1 (Python 2.7) on Ubuntu 14.04

USE PYTHON 2.7 INSTEAD OF PYTHON 3.4 AND INSTALL OPENCV 3.1
WHY: ref:http://www.pyimagesearch.com/2015/07/27/installing-opencv-3-0-for-both-python-2-7-and-python-3-on-your-raspberry-pi-2/
SOME PYTHON PACKAGES STILL USE 2.7 VERSION
http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/
1. Create a new virtualenv with python parameter point to python2.7. ref:http://stackoverflow.com/questions/5506110/is-it-possible-to-install-another-version-of-python-to-virtualenv

2. Check python version:

2.b Just Check python version in another virtualenv (opencv):

OK. PYTHON VERSION IN ANOTHER VIRTUALENV NOT CHANGED (STILL 3.4)

3. Check pip version:

4. Install numpy:

CHECK numpy VERSION:

IMPORTANT: I FOUND AN ERROR ‘The data should normally be NULL! in function allocate’ WHEN TRY TO TEST SIFT Holography Feature Matching (flann.knnMatch). PLS FIX THIS FIRST (SEE SOLUTION IN /media/data/MASTER/opencv/github_list_fish_rec.txt) BEFORE BUILD OPENCV AT STEP #5 BELOW!

5. We already cloned opencv 3.1.0 and opencv_contrib 3.1.0. so now, go to the build and do setup:

6. Compile opencv:

7. Install:

8. If you’ve reached this step without an error, OpenCV should now be installed in /usr/local/lib/python2.7/site-packages
However, our ‘opencv_p27’ virtual environment is located in our home directory — thus to use OpenCV within our cv environment, we first need to sym-link OpenCV into the site-packages directory of the ‘opencv_p27’ virtual environment:

9. Check the installation opencv version:

 

Leave a Reply

Your email address will not be published. Required fields are marked *