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

CentOS 6.5.How to install OpenCV, a cross-platform computer visual library

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces CentOS 6.5 how to install cross-platform computer visual library OpenCV, the content is very detailed, interested friends can refer to, hope to be helpful to you.

The following Opencv2.3.1 version of the installation as an example, for you to do a detailed introduction.

One: install the dependency package

The dependency package can be installed with yum, and the following installation packages are required:

Yum install cmake gcc gcc-c++ gtk+-devel gimp-develgimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devellibpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-develjasper-devel jasper-utils swig python libtool nasm

Second: generate the make file and install it

Opencv2.3.1 can be downloaded from the official website (link to http://opencv.org/ during this period of time the official website jumps to an inexplicable URL), if necessary, you can contact me.

The specific steps are:

(1) cdopencv2.3.1

(2) cmake-DCMAKE_BUILD_TYPE=RELEASE-DCMAKE_ INSTALL_PREFIX=/usr/local-DBUILD_NEW_PYTHON_SUPPORT=NO.

/ / A line44 error may be prompted here. Go in Cmakelist.txt and comment out line 44

/ / notice that there is a space + after NO. essential.

Screenshot indicates that the cmake file was generated successfully.

(3) cmake

(4) sudo makeinstall

Three: configuration

Create a new file / etc/ld.so.conf.d/opencv.conf

Add / usr/local/lib to the file

Execute the configuration after saving

Sudoldconfig

/ / because all / etc/ld.so.conf.d/*.conf files are included in the ld.so.conf file

Four: configuration of environment variables

Sudo vim/etc/bashrc

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

ExportPKG_CONFIG_PATH

Execute after saving

Source / etc/bashrc

five. Test whether the installation is successful

Cd OpenCV-2.3.1/samples/c

Chmod + xbuild_all.sh

. / build_all.sh

Execute after compilation

. / facedetectcascade= "/ usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml"-- scale=1.5 lena.jpg

If the installation is successful, lena will have a blue circle on his face

OpenCV needs to be configured after a successful installation, and this step cannot be saved.

About CentOS 6.5 how to install cross-platform computer visual library OpenCV to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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

Servers

Wechat

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

12
Report