<!-Description the beginning and outline-> I bought an M1 MacBook Air and tried to play with OpenCV triumphantly, but I had a lot of trouble, so I will make a note. I think there is a better way, so for your reference. Qiita is also a beginner so I don't know
<!-Edit title and anchor name->
-Machine: MacBookAir 2020 M1 -Python: 3.8.2 (included from the beginning)
① Install Xcode (may be unnecessary)
② Install Homebrew (maybe unnecessary)
④ Install Cmake (maybe unnecessary) Just in case, cmake gave an error when installing numpy. .. ..
brew install cmake
③ Install Anaconda See here
④ Install OpenCV See here
pip install opencv-python-headless :main module only
⑤ Execute! The test code looks like this
import cv2
img = cv2.imread('image.jpg')
cv2.imshow("image", img)
cv2.waitKey(0)
cv2.destroyAllWindows()
that's all!
Recommended Posts