Thursday, August 13, 2009

Setting up Ubuntu for OpenCV

This article relates how to setup a fresh Ubuntu (9.04 - Jaunty Jackalope) so you can download the latest OpenCV from the repository and then compile it from scratch. Downloading and compiling will be a separate article.

First install some packages using the following commands:
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install mplayer
sudo apt-get install subversion
sudo apt-get install ffmpeg
sudo apt-get install swig
sudo apt-get install python-all
sudo apt-get install python-all-dev
Second install some libraries using the following commands:
sudo apt-get install libxine1
sudo apt-get install libfftw3-3
sudo apt-get install libfftw3-3-dev
sudo apt-get install libfftw3-dev
sudo apt-get install libvorbis-dev
sudo apt-get install libavcodec-dev
sudo apt-get install libavdevice-dev
sudo apt-get install libavfilter-dev
sudo apt-get install libavformat-dev
sudo apt-get install libavutil-dev
sudo apt-get install libmad0
sudo apt-get install libmad0-dev (maybe not necessary)
sudo apt-get install libpostproc-dev
sudo apt-get install libswscale-dev
sudo apt-get install libxine1-ffmpeg
sudo apt-get install libjasper-dev
sudo apt-get install libtiff4-dev
sudo apt-get install libv4l-dev
sudo apt-get install libslang2-dev
sudo apt-get install libxine-dev
sudo apt-get install libdc1394-22-dev
sudo apt-get install libgstreamer0.10-dev
sudo apt-get install libgtk2.0-dev
Now go into Add/Remove Programs
  1. Search for java runtime
  2. Install Sun Java 6 Runtime
*Note: You will want to select All available applications under Show:
Now install unicap

Follow the directions here, then run the following commands:
sudo apt-get install libunicap2
sudo apt-get install libunicap-dev
sudo apt-get install libucil2
sudo apt-get install libucil-dev
sudo apt-get install libunicapgtk2
sudo apt-get install libunicapgtk-dev

* You can also dowloand the tar.gz and compile and make that by hand

* If you are having trouble writing to files with OpenCV after you have installed all the above, please read this link for the fix.

1 comment:

  1. When installing in Ubuntu 9.10 you may also need to install one or more of the following (if you get a gstreamer not found error):

    gstreamer0.10-ffmpeg
    gstreamer0.10-ffmpeg-dbg
    libgstreamer-plugins-base0.10-dev
    libgstreamermm-0.10-2
    libgstreamermm-0.10-dev
    libxml++2.6-dev

    ReplyDelete