Setup

OpenCV installation

We will be installing OpenCV package in Python. For using OpenCV with C++, see OpenCV Linux Install and OpenCV with gcc and CMake. There are 4 different opencv packages.

For desktop environments (GUI support):

  1. opencv-python

    main modules package

  2. opencv-contrib-python

    main + extra modules (OpenCV Docs)

For server setups (no GUI):

  1. opencv-python-headless

  2. opencv-contrib-python-headless

The most preferred version is opencv-python but if you need extra modules install the opencv-contrib-python package.

# Create a virtual environment
python3 -m venv .venv

# Activate environment (In Linux)
source .venv/bin/activate

# Install OpenCV package (It has numpy as dependency so numpy will be installed automatically.)
pip3 install opencv-python

MATLAB

Recommended toolbox:

  1. MATLAB Image Processing Toolbox

  2. MATLAB Computer Vision Toolbox