[Learn OpenCV Introduction] [016] [Redhat under Installation OpenCV]

Source: Internet
Author: User

Installation Environment

Operating system:

Red Hat Enterprise Linux Server 6.3

Related software:

OPENCV-2.3.1A.TAR.BZ2, cmake-3.5.1.tar.gz

OpenCV:

http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2

CMake:

Https://cmake.org/files/v3.5/cmake-3.5.1.tar.gz

installation process

CMake Installation

Description

CMake is a cross-platform installation (compilation) tool that can be used to describe the installation of all platforms (the compilation process) with simple statements. Use it to generate the makefile file that is used to compile OpenCV.

Steps:

1. Unzip

Tar xvf cmake-3.5.1.tar.gz

CD cmake-3.5.1

2. Configuration

mkdir _install//Create Installation Location folder

./configure--prefix=${pwd}/_install//Generate makefile, installation location is _install

3. Compiling

make//Compile source code via makefile

4. Installation

Make install//install compile to file into _install folder.

CP _install/*/USR–RF//copy compiled file to/usr directory

5. Testing

CMake//Execute cmake command displays CMake version number and help information indicates successful installation

OPENCV Installation

Description

OpenCV is a cross-platform computer Vision Library based on the BSD licensing (open source) release. The OpenCV library and header files are required to compile and run a program that calls the OpenCV library function.

1. Unzip

Tar xvf opencv-2.3.1a.tar.bz2

CD OpenCV-2.3.1

2. Configuration

mkdir _install//Create Installation Location folder

Cmake-dcmake_install_prefix=${pwd}/_install//Generate makefile, installation location is _install

3. Compiling

make//Compile source code via makefile

4. Installation

Make install//install compile to file into _install folder.

VI _install/lib/pkgconfig/opencv.pc//modify the Compile link library and header file path

PREFIX=/USR//compile-time link library search from/usr/lib, header file from/usr/include

CP _install/*/USR–RF//copy compiled file to/usr directory

5. Testing

CD samples/c///Enter the sample program to compile the program

g++ ' pkg-config--libs--cflags opencv ' Facedetect.cpp-o facedetect

Compile the source file, g++ means to compile the CPP program ' pkg-config--libs--cflags OpenCV ' to compile the link library and header file

./facedetect lena.jpg//Run a compiled program that identifies the face to indicate a successful installation

[Learn OpenCV Introduction] [016] [Redhat under Installation 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.