Compile OpenCV 4 with Qt 5 for Python 3 and C++ on macOS High Sierra 10.13

This tutorial provides step-by-step instructions to compile OpenCV 4 with Qt 5 for Python 3 and C++ on macOS High Sierra 10.13. For the latest macOS version, I think you can install OpenCV from Homebrew directly. I wrote this tutorial on Dec. 2020 and the High Sierra is a previous macOS system and installing OpenCV directly from Homebrew will fail so I have to compile it manually.

Installation Dependencies

Clone OpenCV

Compile OpenCV

The terminal will display many lines and you need check the following points.

Check Non-free algorithms
Check Python 3

Now, you can start compiling.

Once you’ve reached 100% without any errors, execute.

After installing, you can execute the following command to check pkg-config. The screen should print the installed version (4.5.0) of OpenCV.

Leave a Reply

Your email address will not be published. Required fields are marked *