How to install OpenCV2.3.1 in CentOS 6.5

Source: Internet
Author: User

How to install OpenCV2.3.1 in CentOS 6.5

The installed Linux version is CentOS 6.5 and OpenCV 2.3.1 is selected. Not a very new version. This is because there is a problem in the make process when OpenCV2.4.9 is installed.

I. Install dependency packages

You can install the dependency package using yum. The following installation packages are required:

Yum install cmake 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

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

Install the required OpenCV2.4.1 package in Ubuntu Linux

Install OpenCV2.4.2 on Ubuntu 12.04

OpenCV in CentOS cannot read Video Files

Summary of installing OpenCV 2.4.5 in Ubuntu 12.04

Install OpenCv2.1 in Ubuntu 10.04

Face Recognition System Based on QT and OpenCV

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

Ii. Generate and install the make File

Opencv2.3.1 can be downloaded from the official website (visit http://opencv.org/at this time to visit the website of the official website). If you need it, contact me.

The procedure is as follows:

(1) cdopencv2.3.1

(2) cmake-DCMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =/usr/local-DBUILD_NEW_PYTHON_SUPPORT = NO.

// The line44 error may be prompted here. Enter cmakelist.txt and comment out the 44th rows.

// Note that NO is followed by a space +.

Indicates that the cmake file is successfully generated.

(3) cmake

(4) sudo makeinstall

Iii. Configuration

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

Add/usr/local/lib to the file

Save and execute the configuration

Sudoldconfig

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

Iv. environment variable configuration

Sudo vim/etc/bashrc

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

ExportPKG_CONFIG_PATH

Save and run

Source/etc/bashrc

5. test whether the installation is successful

Cd OpenCV-2.3.1/samples/c

Chmod + xbuild_all.sh

./Build_all.sh

After compilation, execute

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

If the installation is successful, there will be a blue circle on lena's face.

For more details, please continue to read the highlights on the next page:

 

  • 1
  • 2
  • Next Page

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.