一、Anaconda安裝
按照官方安裝步驟:https://docs.anaconda.com/free/anaconda/install/mac-os/ 安裝即可
二、配置步驟
進入PyCharm中Preferences
點擊下面紅框中的下拉,點擊Add Local Interpreter
按照如下所示進行配置
創(chuàng)建項目,如下所示
三、運行代碼
代碼如下(示例):
import cv2
# Load the image
img = cv2.imread('Lenna.png')
# Display the image
cv2.imshow('Lenna', img)
# Wait for a key press and then exit
cv2.waitKey(0)
cv2.destroyAllWindows()
將Lenna.png放到main.py同級目錄下,運行程序,如下所示:文章來源:http://www.zghlxwxcb.cn/news/detail-728243.html
提示:更多內(nèi)容可以訪問Clang’s Blog:https://www.clang.asia文章來源地址http://www.zghlxwxcb.cn/news/detail-728243.html
到了這里,關(guān)于MacOS搭建OpenCV開發(fā)環(huán)境(Python)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!