Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install OpenCV for Ubuntu14.04

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "how to install OpenCV in Ubuntu14.04". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, install OpenCV2.4.13

1. Download the OpenCV source code using wget

Url: https://github.com/Itseez/opencv/archive/2.4.13.zip

Sudo apt-get install wgetsudo wget https://github.com/Itseez/opencv/archive/2.4.13.zip

two。 Decompress the ZIP source file

Sudo apt-get install unzipsudo unzip opencv-2.4.13.zip

3. Go to the source directory and create a release directory

Cd opencv-2.4.13mkdir release

4. Install dependent libraries

Sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev

5. When you go to the release directory and install OpenCV, all files will be placed in this release directory

Cd release

6. Cmake compiles the OpenCV source code, and all lib files installed will be installed in the / usr/local/opencv2.4.13 directory

Cmake-D CMAKE_BUILD_TYPE=RELEASE-D CMAKE_INSTALL_PREFIX=/usr/local/opencv2.4.13..

7. Installation

Sudo make install-J4

Second, configure pkg-config (optional)

1. Create a pkgconfig directory

Mkdir / usr/local/pkgconfig

two。 Copy the opencv.pc file to the pkgconfig directory

Cp / usr/local/opencv2.4.13/lib/pkgconfig/opencv.pc / usr/local/pkgconfig/opencv2.4.pc

3. Open bash with administrator privileges with vim

Sudo vim / .bashrc

4. Add an environment variable on the last line of the file

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/pkgconfigexport PKG_CONFIG_PATH

After 5.wq saves the file, source file (execute script)

Source / .bashrc

6. Test pkgconfig

Pkg-config-libs opencv2.4

7. The results are as follows

This is the end of the content of "how to install OpenCV in Ubuntu14.04". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report