Centos6.7 opencv-2.4.9 Installation
1. The entire process is divided into three steps
1. Install the Basic installation package of centos
2. Install ffmpeg dependent packages and ffmpeg
3. Install opencv
Ii. Steps
1. Install the Basic installation package of centos
Yum install glibc gcc-c ++ autoconfautomake libtool git make nasm pkgconfig
Yum install SDL-devel a52dec a52dec-develalsa-lib-devel
Yum install freetype-devel giflib gsmgsm-devel imlib2 imlib2-devel lame-devel libICE-devel libSM-devellibX11-devel
Yum install libXau-devel libXdmcp-devellibXext-devel libxrandroid-devel libXrender-devel libXt-devel
Yum install mesa-libGL-develmesa-libGLU-devel xorg-x11-proto-devel zlib-devel
Yum install ncurses-devel
Libdc1394-devel yum install libdc1394
Yum install amrnb-devel amrwb-developencore-amr-devel
Yum groupinstall "Development tools"
Yum install bzip2-devel
Yum install openssl-devel
Yum install ncurses-devel
Yum install sqlite-devel
Yum install gtk *
Yum installgtk +-devel libjpeg-devel libtiff-devel jasper-devel libpng-devel cmake
Yum install git gtk2-devel numpy pythonpython-pip python-devel gstreamer-plugins-base-devel libv4l
Yum install cloog-ppl gmp-deve
Yum install gimp-devel-toolsgimp-libs gimp libavc1394 libavc1394-devel libdc1394 libdc1394-devel libraw1394libraw1394-devel
2. Install ffmpeg dependent packages
Yum install xvid4conf xvidcore-develxvidcore libogg-devel liboggz-deve log4c log4cpluslog4cplus-devel log4cpp libvorbislibvorbis-devel
Yum install vorbis-tools libtheora-devel theora-tools faacfaac-devel faad2 faad2-devel lame twolame-devel twolame flamerobin toolameopus-devel opus libvpx-devel libvpx
Yum install libvpx-utils mplayermplayer-gui mplayer-tools mencoder flvtool2.noarch
3. Install ffmpeg
(1) wgethttps: // www.ffmpeg.org/releases/ffmpeg-2.8.tar.gz
(2) tar zxvf ffmpeg-2.8.tar.gz
(3) cd ffmpeg-2.8
(4) PKG_CONFIG_PATH =/usr/local/ffmpeg_build/lib/pkgconfig
Export PKG_CONFIG_PATH
(5 ). /configure ---- prefix = "/usr/local/ffmpeg_build" -- extra-cflags = "-I/usr/local/ffmpeg_build/include" -- extra-ldflags = "-L/usr /local/ffmpeg_build/lib "-- bindir ="/usr/local/bin"
-- Extra-libs =-ldl -- enablel-shared -- enable-gpl
. /Configure-prefix = "usr/local/ffmpeg_build"-extra-cflags = "-I/usr/local/ffmpeg_build/include" -- extra-ldflags = "-L/usr/ local/ffmpeg_build/lib "-- bindir ="/usr/local/bin "-- extra-libs =-ldl -- enablel-shared -- enable-gpl
Make-j8
(7) makeinstall
(8) cd/etc/bashrc
Add
ExportPKG_CONFIG_PATH =/usr/local/ffmpeg_build/lib/pkgconfig: $ PKG_CONFIG_PATH
ExportLD_LIBRARY_PATH =/usr/local/ffmpeg_build/lib: $ LD_LIBRARY_PATH
(9) Enter ffmpeg on the terminal
4. Install opencv
(1) unzip opencv-2.4.9.zip
(2) cd opencv-2.4.9.zip
(3) mkdir build
(4) cmake-D CMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =./build/../opencv-2.4.9
(5) make-j8
(6) make install
(7) input at the terminal
ExportLD_LIBRARY_PATH =/usr/local/opencv-2.4.9/build/lib/: $ LD_LIBRARY_PATH
Or run vim/etc/ld. so. conf.
Add at the end of the file
/Usr/local/opencv-2.4.9/lib
Enter ldconfig on the terminal
(8) run the following command:
Cp/usr/local/opencv-2.4.9/lib/pkgconfig/opencv. pc/usr/lib64/pkgconfig/
Copy/usr/local/opencv-2.4.9/lib/pkgconfig/opencv. pc to/usr/lib64/pkgconfig/
Postscript:
Since we used opencv on windows, we started to use Opencv from windows to linux servers for project purposes. Although it is very easy to install opencv on centos, however, I have been tossing for several days. The main reason is that the related functions in CvCapture cannot be used to determine whether or not the installation packages are not installed, which video-related installation packages are missing, and we have not found out. I will try again later.
Refer:
1. http://wiki.razuna.com/display/ecp/ffmpeg?installation=on=centos=and#redhat;
2. Renew /;
3. http://wanwentao.blog.51cto.com/2406488/435867;
4. http://blog.csdn.net/guojieaix/article/details/44064213