安装OpenCV:
在Terminal中,输入以下pip命令来安装OpenCV:
pip install opencv-python
pip install opencv-contrib-python
如果下载速度较慢,可以考虑使用国内的pip镜像源,如清华大学源:
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple