Install and compile OpenCV one-click script (with FFMpeg) on Ubuntu)

Source: Internet
Author: User
Install and compile OpenCV one-click script (with FFMpeg) Process notes in Ubuntu. 1. Switch to the user directory cd ~ 2. create a new file named opencv. sh Script: version = "$ (wget-q-O-http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep-m1-o '\" [0-9] (\. [0-

Install and compile OpenCV one-click script (with FFMpeg) Process notes in Ubuntu.

1. Switch to the user directory

Cd ~

2. Create a new file named opencv. sh. The script is as follows:

Version = "$ (wget-q-O-http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep-m1-O' \" [0-9] (\. [0-9]) + '| cut-c2 -)"
Echo "Installing OpenCV" $ version
Mkdir OpenCV
Cd OpenCV
Echo "Removing any pre-installed ffmpeg and x264"

Sudo apt-get install unzip

Sudo apt-get install cmake
Sudo apt-get-qq remove ffmpeg x264 libx264-dev
Echo "Installing Dependenices"
Sudo apt-get-qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10- dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
Echo "Downloading OpenCV" $ version
Wget-O opencv-javasversion.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/#version/opencv-"$ version". zip/download
Echo "Installing OpenCV" $ version
Unzip opencv-unzip version.zip
Cd opencv-$ version
Mkdir build
Cd build
Cmake-D CMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =/usr/local-D WITH_TBB = ON-d release = ON-D WITH_V4L = ON-D INSTALL_C_EXAMPLES = ON-d release = ON- D BUILD_EXAMPLES = ON-D WITH_QT = ON-D WITH_OPENGL = ON ..
Make-j2
Sudo checkinstall
Sudo sh-c 'echo "/usr/local/lib">/etc/ld. so. conf. d/opencv. conf'
Sudo ldconfig
Echo "OpenCV" $ version "ready to be used"

3. Modified to Executable

Chmod + x opencv. sh

4. Run

./Opencv. sh

NOTE: If there are no java-related jar and. so files in lib and bin after compilation, you need to install jdk and export the JAVA_HOME variable: for example, 64-bit ubuntu,
Export JAVA_HOME =/usr/lib/jvm/java-7-openjdk-amd64

(Path may differ in your system), cmake generated both:
Build/bin/opencv-249.jar
Build/lib/libopencv_java249.so

------------------------------------------ Split line ------------------------------------------

Compile FFmpeg in Linux and compile the source file

Linux compiling upgrade FFmpeg step http://www.linuxidc.com/Linux/2013-08/88190.htm

Install FFMPEG http://www.linuxidc.com/Linux/2011-09/42793.htm on CentOS 5.6

Install FFmpeg http://www.linuxidc.com/Linux/2012-12/75408.htm in Ubuntu

OpenCV2.4.1 package http://www.linuxidc.com/Linux/2012-08/68184.htm installed in Ubuntu Linux

Ubuntu 12.04 install OpenCV2.4.2 http://www.linuxidc.com/Linux/2012-09/70158.htm

OpenCV in CentOS cannot read video file http://www.linuxidc.com/Linux/2011-07/39295.htm

Summary of installing OpenCV 2.4.5 in Ubuntu 12.04Http://www.linuxidc.com/Linux/2013-06/86704.htm

Install OpenCv2.1 nine-step http://www.linuxidc.com/Linux/2010-09/28678.htm in Ubuntu 10.04

------------------------------------------ Split line ------------------------------------------

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-06/103728.htm

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.