Install Open CV on Raspberry Pi
The process to install openCV will take few around (probably around 10 hours, some cases might be around 6)
The main reason for this is due to setting up the configuration and building openCV code to support what you have setup as your installation configuration.
However, the process is straight forward and only required few steps, which you can follow below.
As with any installation on your Pi, you will want to start with update and upgrade command
When it is done, run the following command: ( these command will take around 10 hours)
run:sudo apt-get update
run: sudo apt-get upgrade
when both the update and upgrade commands finished run the following two commands:
run: sudo apt-get upgrade
sudo apt-get -y install build-essential cmake cmake-curses-gui pkg-config libpng12-0 libpng12-dev libpng++-dev libpng3 libpnglite-dev zlib1g-dbg zlib1g zlib1g-dev pngtools libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools libeigen3-dev
AND
sudo apt-get -y install libjpeg8 libjpeg8-dev libjpeg8-dbg libjpeg-progs ffmpeg libavcodec-dev libavcodec53 libavformat53 libavformat-dev libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev libxine1-ffmpeg libxine-dev libxine1-bin libunicap2 libunicap2-dev swig libv4l-0 libv4l-dev python-numpy libpython2.6 python-dev python2.6-dev libgtk2.0-dev
After the dependencies libraries finished to install go to:
http://opencv.org/downloads.html
and right click and copy the Linux link for the latest release version (the non alpha or beta version).
At the time of this post, the latest version was 2.4.9.
use the wget command to download the Open CV zip file
wget -O openCV-2.4.9.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download
After the download has finished you will have openCV-2.4.9.zip (or if you changed the name after -O that will be the name of your file).
use unzip command to decompress the zip file
unzip openCV-2.4.9.zip
This will create a folder openCV-2.4.9. Go in side that folder and create a new folder name release (that is where we will compile openCV to).
cd openCV-2.4.9
mkdir release
cd release
Now it is time to configure openCV and what you will like to setup openCV with.
It is a long list that you will need to set up, but you can also go with the default. I have included my own settings here:
(Most likely, you will not have anything in the configuration, so you will just need to click 'c' to start the configuration.)
mkdir release
cd release
sudo ccmake ../
(Press 'c' if empty cache configuration)
When you are done toggle the settings press 'c' to configure and press 'g' to generate the makefile from the configuration. It will start running the configuration (no this is not going to take 10 hours, but it is coming).
(Press 'c' if empty cache configuration)
When it is done, run the following command: ( these command will take around 10 hours)
make
sudo make install
At these point you are done installing openCV, so congratulation you did it !!
sudo make install