OpenCV Installation - riplaboratory/Kanaloa GitHub Wiki

Installing/Building OpenCV

This is a step-by-step tutorial to install OpenCV (Open Source Computer Vision Library), a library of functions used for computer vision.

Prerequisites:

  • Ubuntu 18.06
  • ROS

Installation

1. Clone the OpenCV github repository in your Documents folder.

In the command terminal, run

cd ~/Documents

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

2. Navigate to the new folder.

cd Documents/opencv

3. Install the GUI to set up the configuration.

sudo apt install cmake-gui

cmake-gui

4. Configure the build settings.

Click Browse Source and navigate to your opencv folder (you should already be there), then click Open.

Click Configure, and in another terminal window, run

mkdir build

In the GUI, click Configure again.

In the search bar, type “dnn”

Check OPENCV_DNN_CUDA, BUILD_opencv_dnn, and OPENCV_DNN_OPENCL

Click Generate, and close the GUI when it is done.

5. In the terminal window, run

cd Documents/opencv/build

cmake .

make -j8

It will take approximately 10 minutes; do not exit the terminal.

6. In the same terminal window (still in the build directory), run

sudo make install