Much has changed since OpenCV 2.0.. android support, CUDA support, etc are up and running. So is the change in the method of installing OpenCV. So, i though to quickly jot down the steps to follow for a painless install.
I must add, due to changes in gcc, removal of libv4l support from linux kernel, etc.. OpenCV 2.1 and 2.2 give loads of issues during install. I just couldnt manage installing v2.1, though v2.2 needed few hacks as mentioned in the link : https://code.ros.org/trac/opencv/ticket/324 . So, for people wanting to install v2.2, can follow exactly same steps mentioned below after making the above hack. Note that, even UVC-webcams dont work with v2.2. So, if you’re like me, needing lots of webcam feed for vision-based tasks, its best to avoid v2.2. Moral of the story : Go for v2.3..
1. Install the following :
sudo yum install eigen2-devel, CTL, CTL-devel, OpenEXR_CTL-libs, tbb, yasm, yasm-devel, tbb-devel, OpenEXR CTL-devel, OpenEXR CTL, perl-URI, perl-Compress-Raw-Zlib, perl-Compress-Raw-Bzip2, perl-l0-Compress, libucil-clevel, perl-HTML-Tagset, perl-HTML-Parser, perl-Iibwww-perl, perl-XML-Parser, gstreamer-plugins-base-devel, libsigc++20-devel, glibmm24-devel, libxml++-devel, gstreamermm, xine-lib, libunicapgtk-devel, xine-lib-devel, gstreamermm-devel, python-devel, sip-macros, sip, vamp-plugin-sdk, audacity, sip-devel
sudo yum install libXext-clevel, glib2-devel, libXrender-devel, libXﬁxes-devel, Iibunicap, freetype-devel, boost-system, fontconﬁg-devel, libpng-devel, boost-ﬁlesystem, boost-serialization, boost-thread, boost-date-time, boost-regex, libXt-devel, libXdamage-devel, libXcomposite-devel, libXcursor-devel, libXrandr-devel, atk-devel, libXinerama-devel, libXxf86vm-devel, libXi-devel, libxml2-devel, blas-devel, libjpeg-turbo-devel, pixman-clevel, cairo-devel, pango-devel, libdrm-devel, mesa-libGL-devel, boost-graph, boost-wave, libucil, boost-signals, boost-python, boost-iostreams, boost-program-options, boost-random, boost-test, boost, mesa-libGLU-devel, ilmbase-devel, libunicapgtk, gdk-pixbuf2-devel, libibverbs, libmlx4, librdmacm, check, check-devel, boost-jam, rarian, rarian-compat, cmake, plpa-libs, numactl, environment-modules, boost-devel, boost-build, OpenEXR-devel, jasper-devel, lapack-devel, libunicap-devel, libtifl-devel, atlas-devel, openmpi, boost-openmpi, ucview, gstreamer-devel, gtk2-devel, jasper, 0penEXR
sudo yum install xorg-x11-proto-devel, libXau-devel, Iibxcb-devel, libX11-devel, libram1394-devel, automake, libogg-devel, libtheora-devel, libvorbis-devel, libdc1394-devel, x264-devel, faac-devel, xvidcore-devel, dirac-devel, gsm-devel, zlib-devel, faad2-devel, speex-devel, lame-devel, orc-compiler, orc-devel, libvdpau, cppunit, libvdpau-devel, schroedinger-devel, dirac, x264, lame, faad2, amrwb-devel, opencore-amr-devel, amrnb, amrnb-devel
(i have tried copying the package names via OCR software and some editing as much as could be possible from the screenshot below)
Install from Add/Remove Programs (PackageKit)
2. Now, download and Install FFMPEG
- Eventhough FFMPEG is at v0.8.. its best to go for v0.7.. thats coz of several dependency issues. Many things like VLC, etc are based on ffmpeg v0.69 code, and v0.8 MAY give lots of issues..
- Download ffmpeg 0.7 from : http://ffmpeg.org/releases/ffmpeg-0.7.1.tar.bz2
- extract the above file (say files get extracted to /home/user/ffmpeg)
- Open terminal and cd to above location.. i.e. : cd /home/user/ffmpeg
- Now type the following :
./configure –enable-gpl –enable-version3 –enable-nonfree –enable-postproc –enable-libfaac –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libtheora –enable-libvorbis –enable-libxvid –enable-x11grab –enable-swscale –enable-shared
sudo make install
- And you are done.. FFMPEG is ready to be integrated with OpenCV.
3. Download OpenCV 2.3 . Extract to a folder (say /home/user/Opencv-2.3)
- There still are a few packages of ffmpeg like libavcodec-dev, libavutil-dev, etc which need to be present in /usr/local/ffmpeg/ . But, the above install of ffmpeg doesnt create this. So, open Add/Remove Programs and install following or install using yum:
sudo yum -y install ffmpeg ffmpeg-devel ffmpeg-libs
- Now, the requisite libraries are all present in the location OpenCV can find them. Open terminal and cd to the OpenCV folder.. i.e.
- Create a folder called Release
- cd to the Release folder and type the following to install OpenCV
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_CUDA=OFF -D WITH_V4L=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_FFMPEG_BUILD=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_IPP=OFF -D BUILD_EXAMPLES=ON ..
make -j 2
sudo make install
- Few more steps need to be done to ensure flawless build.
sudo gedit /etc/ld.so.conf.d/opencv.conf
(Type the following and save-close the file) : /usr/local/lib
sudo gedit /etc/bashrc
(Type the following and save-close the file) :
And you are done !!! 🙂 OpenCV 2.3 with ffmpeg support is ready to be used on Fedora 15 with full webcam support.. ENJOY !!
NOTE : due to requests for Ubuntu specific steps, i’ll put the changed steps in this post itself in a few days