Ubuntu12.04 install OpenCV2.4.6.1

Source: Internet
Author: User
Install OpenCV2.4.6.1 in Ubuntu12.04

OpenCV2.4.6.1 Installation Process in Ubuntu 12.04:

Related reading:

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

1. Install the compilation environment and related libraries

Sudo apt-get install cmake build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev libjpeg62-dev libtiff4-dev libjasper-dev

2. Download The OpenCV source code and compile it.

Tar-xvf

Go to the extract directory,

Cmake. # generate the compilation configuration file

Make # compile. Compile in different linux systems. You may need to install more libraries for compiling dependencies. Follow the prompts to install whatever is missing.

Make install # install it. It is installed under/usr/local by default.

3. Update the dynamic link library and configuration file

Sudo gedit/etc/ld. so. conf. d/opencv. conf # Add the path of the opencv lib Library:/usr/local/lib, save

Sudo ldconfig # configure

Update the configuration file: sudo gedit/etc/bash. bashrc

Add at the end:

PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

Export PKG_CONFIG_PATH

Iv. test Sample

Go to the sample/c directory:

./Facedetect -- cascade = "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" -- scale =. 5./lena.jpg

Output the face detection result. OK.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.