Skip to content

OpenCV installation

Paul Zabelin edited this page Sep 9, 2020 · 2 revisions

OpenCV is a large library to install on CI.

brew install opencv brings a lot of dependencies that often are not necessary.

Unfortunately maintainers of opencv brew formular has not declared dependencies as optional.

Minimal installation

Since macOS test is only using small part of the library it is possible to install OpenCV without most of dependencies.

brew deps opencv --1 will show list of immediate dependencies.

To figure out which dependencies are necessary:

  1. Install OpenCV without any dependency.
  2. Run OpenCV Tests in Xcode.
  3. Notice which dependency is required.
  4. Install missing dependency.
  5. Repeat from step 2.

Update list of necessary dependencies in Example/OpenCV-OSX-Tests/install-opencv.sh

Complete uninstall

including dependencies

Example/OpenCV-OSX-Tests/uninstall-opencv.sh

Build Time Saved

Installation Time Command
Full 5 minutes brew install opencv
Minimal 2 minutes install-opencv.sh
Cache 30 seconds actions/cache+install-opencv.sh
Clone this wiki locally