Compiling and installing opencv in Linux (UBUNTU)

Source: Internet
Author: User

Compiling and installing opencv in Linux (UBUNTU)

 
 

1. Install the relevant libraries first:

Sudo apt-Get install build-essential

 
 

Sudo apt-Get install libv4l-dev libv4l-0 libboost1.40-all-Dev Libusb-1.0-0-dev libgtk2.0-dev libgsl0-dev

 
 

2. decompress the opencv2.0 source code and enter the directory. Use the following statement to configure and install it:

./Configure

Make

Sudo make install

 
 

3. Set the relevant library path:

Use the root user to perform the following operations

Add the path/usr/local/lib to the file/etc/lD. So. conf.

 
 

4. Reload the library path:

Ldconfig

 
 

5,Test the installation package

To test whether the installation is successful, you can use the following command line to compileSource codePackageDrawing. cExample: (IN Version 1.0, It is located under the sample/C directory)

G ++'Pkg-config opencv -- Libs -- cflags opencv'Drawing. C-o drawing

After successful compilation, you should be able to execute./DrawingSeeHighguiThe result of the output window is displayed.

 
 

After installation, the path is:/Usr/local/lib/usr/local/include/opencv

 
 

 
 

 
 

 
 

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.