Installing SimpleCV with Python 2.7.5 in Virtualenv in Ubuntu 13.10

1. sudo apt-get build-dep python-opencv
2. sudo apt-get install python-opencv
3. sudo apt-get install python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev mercurial
4. Get the paths for cv2.so and cv.py by applying dpkg -L python-opencv
/usr/lib/pyshared/python2.7/cv2.so
/usr/share/pyshared/cv.py
5. virtualenv simplecv_venv
cd simplecv_venv
ln -s /usr/lib/pyshared/python2.7/cv2.so lib/python2.7/site-packages/cv2.so
ln -s /usr/share/pyshared/cv.py lib/python2.7/site-packages/cv.py
sudo ./bin/pip install https://github.com/numpy/numpy/zipball/master
sudo ./bin/pip install cython
sudo ./bin/pip install scipy
sudo ./bin/pip install PIL
sudo ./bin/pip install ipython
mkdir src
wget -O src/pygame.tar.gz https://bitbucket.org/pygame/pygame/get/6625feb3fc7f.tar.gz
cd src
tar zxvf pygame.tar.gz
cd ..
sudo ./bin/python src/pygame-pygame-6625feb3fc7f/setup.py -setuptools install
sudo ./bin/pip install https://github.com/sightmachine/SimpleCV/zipball/develop
6. Test installation with the following webcam capture code, you’ll need to install the following module:
sudo bin/pip install svgwrite
7. Activate simplecv virtual environment:
$ source bin/activate
8. Open ipython and run the following code:
(simplecv_venv)$ipython
In [1]: run simplecv_helloworld.py
Code:

from SimpleCV import Camera, Display, Image
# Initialize the camera
cam = Camera()
# Initialize the display
display = Display()
# Snap a picture using the camera
img = cam.getImage()
# Show the picture on the screen
img.save(display)

Exit ipython to stop the code running.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s