当你执行 $brew link texi2html时又会遇错:
Error: Cowardly refusing to 'sudo brew link'
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so atyour own risk
说明brew 的权限有问题, 需要解决:
$sudo chown root:wheel ‘which brew’
在Ubantu上安装先要做一下准备活动
$ aptitude -f install $ sudo apt-get update然后安装编译环境:
$sudo apt-get install build-essential
安装依赖库
$sudo apt-get install cmake Git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
还要安装python 依赖及其它依赖库
$sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
获得opencv源代码
git clone https://github.com/Itseez/opencv.git
终于可以编译安装了:
$cd opencv $cmake -D CMAKE_INSTALL_PREFIX=/home/opencv/build -D CMAKE_BUILD_TYPE=RELEASE ..最后,安装python-opencv:
$sudo apt-get install python-opencv
OpenCV的Python环境简单验证一行代码验证OpenCV的Python环境是否成功:
$python -c “import cv2; print dir(cv2)”
如果输出了很多cv2 的属性和函数名的字典,就表示成功;否则的话,还需要继续填坑。
下面关于OpenCV的文章您也可能喜欢,不妨参考下:
Ubuntu 16.04上用CMake图形界面交叉编译树莓派的OpenCV3.0
CentOS6.5上配置Python2.7+OpenCV2.4.13
Ubuntu 16.04下Matlab2014a+Anaconda2+OpenCV3.1+Caffe安装
Ubuntu 16.04下TensorFlow+Caffe+OpenCV3.1+Theano部署
Ubuntu 16.04 编译安装OpenCV 3.1及OpenCV多版本切换