Downloading OpenCV

To begin with, you'll need to download a copy of the OpenCV libraries. The best way to obtain a copy is to use the CVS repository, but if you don't have any way of using CVS then you'll have to do it by downloading from sourceforge.

Downloading from Sourceforge

Be aware that the downloads are listed in a rather unhelpful order, so simply scroll to the bottom and select the most recent release from opencv-linux or opencv-win. At the time of writing, this version did not work with ffmpeg so using it for video didn't work. If you want to use OpenCV with video files, see below.

sourceforge.net/projects/opencvlibrary

Installing on Linux     |      Installing on Windows

CVS Repository

Downloading from the CVS gives you the very latest source code and libraries, with the slight possibility of errors during compilation. However, these are rare and usually very simple to rectify.
In Windows you will need a client compatible with CVS (such as Eclipse), and the information available here. On Linux (assuming CVS is installed) you can simply type the following on the command line:

cvs -z3 -d:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:/cvsroot/opencvlibrary co -P opencv

Installing on Linux      |      OpenCV CVS instructions

OpenCV With Video (Linux Only)

The advantage of downloading the CVS copy is that it can be used in conjunction with ffmpeg, allowing for reading and writing of videos as well as single images. 4 days and many, many installations have confirmed that in fact the only way to use ffmpeg with OpenCV is to download the SVN and CVS versions (respectively), install ffmpeg and then install OpenCV. I realise that SVN is rarely installed by default and have included a link to the SVN download site for your information.

If you know what they do, simply open a terminal and type:
      svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
      cvs -z3 -d:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:/cvsroot/opencvlibrary co -P opencv

If you have no idea what I'm on about but want to use video, read these:

ffmpeg SVN instructions      |      OpenCV CVS instructions

Installing on Linux