mac install opencv with python

Step1:Install Homebrew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update

Step2: Install Python 2.7 and Python 3 using Homebrew

$ brew install python python3
$ brew linkapps python
$ brew linkapps python3
$ which python
$ which python3

Step3: Install OpenCV 3 with Python bindings on macOS using Homebrew

if use python as programming language

$ brew tap homebrew/science
$ brew install opencv3 --with-contrib --with-python3 --HEAD

if use java as programming language

brew install opencv3 --HEAD --with-contrib --with-java

Step4: bash_profile

create bash_profile in home address

touch ~/.bash_profile
open ~/.bash_profile

add sentence in this file

# Homebrew
export PATH=/usr/local/bin:$PATH

save it in terminal

source .bash_profile

in new terminal

pkg-config --libs opencv
pkg-config --cflags opencv

Reference

http://www.jianshu.com/p/3d149f167b41
http://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/ (太复杂)
Start with brew doctor which will show you errors with your brew setup.
http://www.jianshu.com/p/b9b35db5f084 (fix error)

Follow up1: xcode and python

https://vandadnp.wordpress.com/2012/07/05/building-and-running-python-scripts-with-xcode-4-x/
point: Cmd+Shift+G to “Go to Folder” and then I type in /usr/bin/python

Follow up2: opencv and java

http://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html#introduction-to-opencv-for-java

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值