- OS: Ubuntu / macOS
- CMake >= 3.20
- gcc
- g++
- Python >= 3.6
git clone --branch 5.x https://github.com/opencv/opencv
cmake -B opencv-build -S opencv -DCMAKE_INSTALL_PREFIX=opencv-build/install # Add -DWITH_ZLIB=OFF on macOS
cmake --build opencv-build --target install -j6
# Install Python package. Uninstall old ones first.
python3 -m pip uninstall opencv-python
python3 -m pip install opencv-build/python_loader