Install OpenCV2.3.1 in Ubuntu11.10

Source: Internet
Author: User
Install and configure OpenCV2.3.1 correctly in ubuntu. complete these steps and run the following command to delete any old versions of ffmpegandx264. Sudoapt-getremoveffmpegx264libx264-d... installation process
To correctly install and configure OpenCV 2.3.1 in ubuntu, complete these steps.
 
Run the following command to delete any old versions of ffmpeg and x264. if they have not been installed before, there is no problem.
Sudo apt-get remove ffmpeg x264 libx264-dev
 
Download and install all dependencies of x264 and ffmpeg:
Sudo apt-get update
Sudo apt-get install build-essential checkinstall git cmake libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-libdev VA-dev has-libdev Vorbis- dev libx11-dev libxfixes-dev libxvidcore-dev texi2html yasm zlib1g-dev
 
Download and install gstreamer:
Sudo apt-get install plugin-0 plugin-dev gstreamer0.10-tools gstreamer0.10-plugins-base libgstreamer-plugins-base0.10-dev gstreamer0.10-plugins-good gstreamer0.10-plugins-Uugly gstreamer0.10-plugins-bad gstreamer0.10-ffmpeg
 
Download and install x264:
Download a recent stable snapshot of x264 version, which is: ftp://ftp.videolan.org/pub/videolan/x264/snapshots/. the downloaded version has no strict requirements.
Run the following command to configure and build x264:
Tar xvf x264-snapshot-20120214-2422-stable.tar.bz2
 
Cd x264-snapshot-20120214-2422-stable/
 
./Configure -- enable-static
Make
Sudo make install
 
Download and install ffmpeg.
Download ffmpeg 0.8.x, address: http://ffmpeg.org/download.html. note: OpenCV2.3.1 earlier versions need ffmpeg 0.7.x.
Run the following command to configure and build ffmpeg:
Tar xvf ffmpeg-0.8.10.tar.bz2
 
Cd ffmpeg-0.8.10/
 
. /Configure -- enable-gpl -- enable-libfaac -- enable-libmp3lame -- enable-libopencore-amrnb -- enable-libopencore-amrwb -- enable-libtheora -- enable-libvorbis -- enable-libx264 -- enable libxvid -- enable -nonfree -- enable-postproc -- enable-version3 -- enable-x11grab
Make
Sudo make install
 
Download and install gtk:
Sudo apt-get install libgtk2.0-0 libgtk2.0-dev
 
Download and install libjpeg:
Sudo apt-get install lib1_62 libjpeg62-dev
 
Download and install v4l (video for linux ).
Download v4l-utils-0.8.5.tar.bz2 from http://www.linuxtv.org/downloads/v4l-utils/
Build v4l:
Make
Sudo make install
 
Download and install OpenCV.
Download OpenCV 2.3.1 from http://sourceforge.net/projects/opencvlibrary/files/
Run the following command:
Tar xvf OpenCV-2.3.1.tar.bz2
Cd OpenCV-2.3.1/
Mkdir build
Cd build
Cmake ..
 
Make
Sudo make install
 
 
Configure Linux. openCV parameters
 
Add a line to the/etc/ld. so. conf. d/opencv. conf file:/usr/local/lib. for example, run the following command:
 
Sudo vi/etc/ld. so. conf. d/opencv. conf
G
O
/Usr/local/lib

: Wq!
 
Add the following to/etc/bash. bashrc:
 
PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
Export PKG_CONFIG_PATH
 
Restart.
After completing the above steps, you should be able to compile the OpenCV application.
 
Run the following command:
 
G ++ 'pkg-config opencv -- cflags ''pkg-config opencv -- Libs' my_code.cpp-o my_code
 
 
 
From Giraffe
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.