[TOC]

概述

源码下载:https://github.com/opencv/opencv/releases/tag/2.4.13.4

源码编译

编译配置:

  1. 编译类型为release
1
2
3
$ cd opencv-2.4.13
$ mkdir build
$ cd build
1
2
3
4
5
6
7
8
9
10
#编译配置
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=~/03.ProgramSpace/15.CLang/03.Source/OpenCV-2.4.13.4/opencv-2.4.13.4/build/install \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D BUILD_EXAMPLES=ON ..
1
2
$ sudo make -j n(n并行线程数,根据CPU决定)
$ sudo make install