Skip to content

Instantly share code, notes, and snippets.

@hongry18
Created May 24, 2019 06:55
Show Gist options
  • Save hongry18/bfbcb16768eed52a06ed91735840b8e0 to your computer and use it in GitHub Desktop.
Save hongry18/bfbcb16768eed52a06ed91735840b8e0 to your computer and use it in GitHub Desktop.

OPENCV Install

reference

[https://docs.opencv.org/3.3.0/d7/d9f/tutorial_linux_install.html]

Required Packages

  • GCC 4.4.x or later
  • CMake 2.8.7 or higher
  • Git
  • GTK+2.x or higher, including headers (libgtk2.0-dev)
  • pkg-config
  • Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
  • ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
  • [optional] libtbb2 libtbb-dev
  • [optional] libdc1394 2.x
  • [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev
  • [optional] CUDA Toolkit 6.5 or higher
# compiler
sudo apt-get install build-essential

# required
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev

# optional
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

JAVA & ANT

Getting OpenCV Source Code

git clone https://github.com/opencv/opencv.git

Building OpenCV from Source Using CMake

cd opencv
mkdir build
cd build

cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/use/local \
-D BUILD_SHARED_LIBS=OFF ..

make -j 4 # number 4 is jobs count
sudo make install
  • java를 사용하기위해 BUILD_SHARED_LIBS=OFF 옵션

Running tests

<cmake_build_dir>/bin/opencv_test_core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment