Skip to content

Instantly share code, notes, and snippets.

@nucliweb
Last active May 12, 2024 18:07
Show Gist options
  • Save nucliweb/b2a234c673221af5ec24508da7d8b854 to your computer and use it in GitHub Desktop.
Save nucliweb/b2a234c673221af5ec24508da7d8b854 to your computer and use it in GitHub Desktop.
OpenCV C++ Mac M1 Installation Steps

📺 OpenCV C++ Mac M1 Installation Tutorial Video

Commands you need

We need homebrew installed in our system

brew install cmake

mkdir Open_CV && cd Open_CV

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

mkdir build && cd build

cmake ../opencv/ .

arch -arm64 cmake ../opencv/ -DWITH_QT=OFF -DWITH_OPENGL=OFF -DFORCE_VTK=OFF -DWITH_TBB=OFF -DWITH_GDAL=OFF -DWITH_XINE=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DBUILD_TESTS=OFF .

arch -arm64 sudo make -j 4

arch -arm64 sudo make install
@henrydrp10
Copy link

Hello, thank you for this. I tried to run an OpenCV example code but I get this:

opencv_test.cpp:2:10: fatal error: 'opencv2/imgproc.hpp' file not found #include "opencv2/imgproc.hpp"

How can I do to include the different header files in the compilation?

Thank you.

@nucliweb
Copy link
Author

Hi @henrydrp10

Can you share the system and hardware that you are using?

@henrydrp10
Copy link

Hi @nucliweb

Sorry for bothering. I went into the video tutorial and I managed to understand how compilation is done (using CMakeLists and makefiles). I had just compiled using the g++ command and therefore the libraries had not been included properly.

Thank you.

@nucliweb
Copy link
Author

Great! 🚀

@mcserni
Copy link

mcserni commented Dec 8, 2023

Great! thank you!

@khachaturyan-1991
Copy link

@henrydrp10 may you please share a link to the video tutorial? I faced the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment