Learning OpenCV with C in Linux
by Gary Bradski and Adrian Kaehler
Overview
Downloading and Installing OpenCV
Getting OpenCV Source Code
- Getting the Latest Stable OpenCV Version You can download the OpenCV source from: http://opencv.org/releases.html
- Getting the Cutting-edge OpenCV from the Git Repository
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
Required Packages
- GCC 4.4.x or later
- CMake 2.8.7 or higher Download the source code from https://cmake.org/download
tar xzf cmake-3.9.0.tar.gz
cd cmake-3.9.0
./bootstrap
cmake
make
sudo make install
Building OpenCV from Source Using CMake
- Create a temporary directory The generated Makefiles, project files as well the object files and output binaries are put there.
cd ~/opencv
mkdir build
cd build
cmake []
For ex.,
cmake /home/jerry/personal/opencv/opencv-3.2.0
Options:
- Building python
- Building java
- Some parameters
- build type: CMAKE_BUILD_TYPE=Release\Debug
- to build with modules from opencv_contrib set OPENCV_EXTRA_MODULES_PATH to
- set BUILD_DOCS for building documents
- set BUILD_EXAMPLES to build all examples
make -j7
留言