Install OpenCV on CentOS 6.5

OpenCV(Open Computer Version), strong open source library, can process the images,videos and others.

DOWNLOAD & INSTALL

1.Download with the command:
$wget http://jaist.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.8/opencv-2.4.8.zip

I suppose your download location is ~/Downloads/opencv-2.4.8.zip

2.Unpack the file
$unzip opencv-2.4.8.zip

You will get a folder named opencv-2.4.8

3.Move the folder to your workspace
$mv opencv-2.4.8 path_of_your_workspace

4.Configure and install
$cd path_of_your_workspace/opencv-2.4.8/
$mkdir release
$cd release
$cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..

cmake is a command, if bash says “bash: cmake command not found”, you can type $type cmake to find the command, and replace the cmake with your cmake absolute path.

$make

When execute the commmand $make, the output may like this

###output start##########
CMake Error at /home/xinspace/Item/opencv-2.4.8/cmake/cl2cpp.cmake:50 (string):
string does not recognize sub-command MD5

make[2]: [modules/ocl/opencl_kernels.cpp] Error 1
make[1]:
[modules/ocl/CMakeFiles/opencv_ocl.dir/all] Error 2
make: *** [all] Error 2

######output end##########

Maybe the cmake version is too old(2.6), try 2.12 installed from source.You can get the guide of installing the lastest version of cmake from source by following this link: http://blog.xinspace.name/2014/04/15/install-cmake-on-centos-6-5/
After update your cmake, you should go back to step 4 cmake command line(the line under $cd release).

$sudo make install

Then you finish the guide.

ORIGINAL ARTICLE:http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation