SimpleCV
The Open Source Framework for Machine Vision
Install / Use
/learn @sightmachine/SimpleCVREADME
SimpleCV
[!WARNING]
This project is no longer actively maintained. For new computer vision projects, consider using alternatives like:
- OpenCV - A powerful library for computer vision tasks with wide-ranging support and active community development.
- PyTorch + TorchVision - A framework for deep learning and computer vision tasks.
- TensorFlow - A robust ecosystem for machine learning and computer vision.
- scikit-image - A lightweight image processing library for Python.
While there are no current plans for updates, this project may be revisited in the future. For legacy projects requiring SimpleCV, the codebase is provided as-is.
Quick Links:
- About
- Installation
- [Docker] (#docker)
- Ubuntu
- Virtual Environment
- Arch Linux
- Fedora
- MacOS
- Windows
- Raspberry Pi
- SimpleCV Shell
- Videos & Tutorials
- SimpleCV on Mobile - Android
- Help
- Troubleshooting Installation
<a id="about"></a>
About
Make computers see with SimpleCV, the Open Source Framework for Computer Vision
SimpleCV is a framework for Open Source Machine Vision, using OpenCV and the Python programming language. It provides a concise, readable interface for cameras, image manipulation, feature extraction, and format conversion. Our mission is to give casual users a comprehensive interface for basic machine vision functions and an elegant programming interface for advanced users.
We like SimpleCV because:
- Even beginning programmers can write simple machine vision tests
- Cameras, video files, images, and video streams are all interoperable
- Information on image features can be extracted, sorted and filtered easily
- Manipulations are fast, with easy to remember names
- Linear algebra is strictly optional
Here is the simplecv "hello world":
import SimpleCV
camera = SimpleCV.Camera()
image = camera.getImage()
image.show()
For more code snippets, we recommend the SimpleCV examples website or looking at our example scripts in SimpleCV/examples
<a id="installation"></a>
Installation
The easiest way to install SimpleCV is with the packages for your distribution (Windows, Mac, Linux) included on the website (http://www.simplecv.org). Although it is tested on many platforms there maybe scenarios where it just won't work with the package installer. Below is instructions on how to install, if you have problems please see the troubleshooting section at the end of this README file.
<a id="docker"></a>
Docker
This is the recommended way of installing SimpleCV as you can be sure the environment will be setup the same exact way as it's suppose to be on your machine.
WARNING: Using docker does not allow the webcam to work, it also doesn't work with Image.show(), so essentially requires you to use simplecv within an IPython notebook.
The first step is to install docker on your machine if you have not, this should work for Windows, Mac, and Linux, please follow instructions at: <a href="https://docs.docker.com/installation/">https://docs.docker.com/installation/</a>
Once docker is installed you can run simplecv as easy as (may have to run as sudo, depending on OS):
docker pull sightmachine/simplecv
It will probably take a little while to download, but once done just run (may need to run as sudo, depending on OS):
docker run -p 54717:8888 -t -i sightmachine/simplecv
Then just open your web browser and go to:
http://localhost:54717
NOTE: If you are using a Mac or Windows it will be a little different since you will be boot2docker to run. When you run boot2docker up it should show the ip address of the docker service. It could be something like 192.168.59.103, but this will change as it's random. Once you know that ip you will just go to that IP address with the correct port instead:
http://192.168.59.103:54717
You will get a Ipython notebook inteface, start a new notebook and enter the following:
from SimpleCV import *
disp = Display(displaytype='notebook')
img = Image('simplecv')
img.save(disp)
You should now see the simplecv logo and now have a full simplecv environment setup to start playing around.
<a id="ubuntu-1204"></a>
Ubuntu 12.04
Install with pip
sudo apt-get install ipython python-opencv python-scipy python-numpy python-pygame python-setuptools python-pip
sudo pip install https://github.com/sightmachine/SimpleCV/zipball/develop
Install using clone of SimpleCV repository
sudo apt-get install ipython python-opencv python-scipy python-numpy python-pygame python-setuptools git
git clone https://github.com/sightmachine/SimpleCV.git
cd SimpleCV/
sudo pip install -r requirements.txt
sudo python setup.py install
then just run 'simplecv' from the shell.
Virtualenv
This is how to install SimpleCV under a python virtual environment [virtualenv] (http://www.virtualenv.org). This maybe useful in cases where you want to keep your system libraries clean and not install extra libraries. This method has only been tested on Ubuntu 12.04, it maybe possible to port to other operating systems.
Run the following commands:
sudo apt-get install python-opencv python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev mercurial
sudo pip install virtualenv
virtualenv venv
cd venv
mkdir src
ln -s /usr/local/lib/python2.7/dist-packages/cv2.so lib/python2.7/site-packages/cv2.so
ln -s /usr/local/lib/python2.7/dist-packages/cv.py lib/python2.7/site-packages/cv.py
./bin/pip install -r requirements.txt
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 ..
./bin/python src/pygame-pygame-6625feb3fc7f/setup.py -setuptools install
./bin/pip install https://github.com/sightmachine/SimpleCV/zipball/develop
<a id="archlinux"></a>
Arch Linux
Install using pip
pacman -S python2-numpy opencv2.4.4_1 python-pygame python2-setuptools ipython2 python2-pip
pip install https://github.com/sightmachine/SimpleCV/zipball/develop
Install using clone of SimpleCV repository
pacman -S python2-numpy opencv2.4.4_1 python-pygame python2-setuptools ipython2
git clone https://github.com/sightmachine/SimpleCV.git
cd SimpleCV/
sudo python setup.py install
Install development version using aur
yaourt -S simplecv-git
<a id="fedora"></a>
Fedora
Fedora 20 and above
sudo yum -y install python-SimpleCV
Fedora 18
Install with pip
sudo yum -y install python-ipython opencv-python scipy numpy pygame python-setuptools python-pip
sudo python-pip install https://github.com/sightmachine/SimpleCV/zipball/develop
Install using clone of SimpleCV repository
sudo yum -y install python-ipython opencv-python scipy numpy pygame python-setuptools python-pip git
git clone https://github.com/sightmachine/SimpleCV.git
cd SimpleCV/
sudo python setup.py install
<a id="macos">
### Mac OS X (10.6 and above)
</a>
General OSX Overview
Note: We originally tried to bundle all Mac dependencies in a superpack. This turned out to be extremely difficult with the many differences between versions of Mac OS. Now, with Mac, you must build from source and we will try and make it as easy as possible. Please report a bug if you have issues.
Explicit (as in every step) instructions compliments of JHawkins
These instructions are geared towards people who are just getting started with python development on OSX. They will walk you through setting up all the tools you need to build SimpleCV from scratch. If you don't know which instructions you want, you probably want to use these.
Install Xcode via App Store Start Xcode and go to Xcode >> Preferences >> Downloads >> click Install across from Command Line Tools If Terminal is already running, shut it down and reopen it OS X's permissions on /usr/local are too restrictive and must be changed via:
sudo chown -R `whoami` /usr/local
Install homebrew via Terminal using:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Ignore the single warning that instructs you to install Xcode's CLI tools (you did that already) To verify that homebrew is installed correctly and working, run:
brew doctor
Address any errors before moving on. Remember, Google is your friend. Note: If you run VM's on my via Parallels and run into multiple warnings related to "osxfuse" thi go to System Preferences >> FUSE for OS X >> Click Remove OSXFUSE. I can add it back later if needed. Once the doctor tells you that you are 'raring to brew', run:
brew update
followed by
brew upgrade
Install OpenCV via homebrew by running:
brew tap homebrew/science
brew install opencv
Be sure to add the requested line to you ~/.bash_profile:
export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"
Source your ~/.bash_profile file so that the changes take effect:
source ~/.bash_profile
Install Git via homebrew by running:
brew install git

