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]