mac-python-opencv 亦凉 2022-07-14 22:20 118阅读 0赞 首先确保已经安装了Python Mac 下可以直接使用 `brew` 来安装OpenCV,具体步骤如下: # add opencv brew tap homebrew/science # install opencv brew install opencv 安装必要的python库 pip install numpy pip install matplotlib 测试是否安装成功 import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('road.png', 0) plt.imshow(img, cmap='gray', interpolation='bicubic') plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis plt.show() ``
还没有评论,来说两句吧...