#Install opencv MacOSX Mavericks
- fire up xcode - to insure that command line tools are there.
- xcode-select --install (older OS?)
- https://developer.apple.com/downloads/index.action# (you need an apple developer account, use your apple id)
- brew update
- brew tap homebrew/science
Cloning into '/usr/local/Library/Taps/homebrew-science'... remote: Reusing existing pack: 3765, done. remote: Counting objects: 63, done. remote: Compressing objects: 100% (63/63), done. remote: Total 3828 (delta 27), reused 0 (delta 0) Receiving objects: 100% (3828/3828), 974.71 KiB | 1.38 MiB/s, done. Resolving deltas: 100% (1782/1782), done. Tapped 244 formula
If your py is in good shape you may be able to skip down to 'brew install opencv'. No harm in trying.
- brew uninstall python
- brew unlink python
- brew install python - (many bad links to delete here, ended up forcing it)
> brew link --overwrite python Linking /usr/local/Cellar/python/2.7.6... 35 symlinks created
- pip install numpy... expect a ton of very helpful warnings and complicated-looking output, followed by
Successfully installed numpy Cleaning up...
- Add to .bashrc or .zshrc:
export PYTHONPATH=/usr/local/Cellar/opencv/2.4.7.1/lib/python2.7/site-packages:$PYTHONPATH
finally, in a new terminal window:
brew install opencv
➜ we-main git:(feature/112-org-thumb) ✗ rvm:(ruby-2.0.0-p247@we) brew install opencv ==> Installing dependencies for opencv: cmake, libpng ==> Installing opencv dependency: cmake ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.12.2.mavericks.bottle.2.tar.gz ######################################################################## 100.0% ==> Pouring cmake-2.8.12.2.mavericks.bottle.2.tar.gz /usr/local/Cellar/cmake/2.8.12.2: 701 files, 36M ==> Installing opencv dependency: libpng ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.5.17.mavericks.bottle.1.tar.gz ######################################################################## 100.0% ==> Pouring libpng-1.5.17.mavericks.bottle.1.tar.gz /usr/local/Cellar/libpng/1.5.17: 15 files, 1.0M ==> Installing opencv ==> Downloading https://github.com/Itseez/opencv/archive/2.4.7.1.tar.gz ######################################################################## 100.0% ==> Patching patching file cmake/OpenCVFindOpenNI.cmake ==> cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.7.1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DCMAKE_OSX_DEPLOYMENT_TA ==> make ==> make install ==> Caveats Set PYTHONPATH if you need Python to find the installed site-packages: export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH ==> Summary /usr/local/Cellar/opencv/2.4.7.1: 217 files, 39M, built in 113 seconds
Get a look
brew info opencv
opencv: stable 2.4.7.1 http://opencv.org/ /usr/local/Cellar/opencv/2.4.7.1 (217 files, 39M) * Built from source From: https://github.com/homebrew/homebrew-science/commits/master/opencv.rb ==> Dependencies Build: cmake ✔, pkg-config ✔ Required: libpng ✔ Optional: eigen ✘, libtiff ✔, jasper ✔, tbb ✘, qt ✔, openni ✘, ffmpeg ✘ ==> Options --32-bit Build 32-bit only --c++11 Build using C++11 mode --with-eigen Build with eigen support --with-ffmpeg Build with ffmpeg support --with-jasper Build with jasper support --with-libtiff Build with libtiff support --with-openni Build with openni support --with-qt Build the Qt4 backend to HighGUI --with-tbb Enable parallel code in OpenCV using Intel TBB --without-opencl Disable gpu code in OpenCV using OpenCL ==> Caveats Set PYTHONPATH if you need Python to find the installed site-packages: export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
##Notes on implementation
- example using opencv to detect a face: https://github.com/ruby-opencv/ruby-opencv/blob/master/test/samples/haarcascade_frontalface_alt.xml.gz
- Get the points from opencv: http://www.ruby-doc.org/gems/docs/o/opencv-0.0.6/OpenCV/CvPoint.html
Hello there, I followed all steps and its work perfectly , now after installing all the things , in new terminal when I write command like "python" - it was show me python editor with python compiler ,
now in this when I wrote like this "import opencv", it was showing me like this error
Last login: Sat Mar 14 13:54:06 on ttys000
Bhaviks-MacBook-Pro:~ R0b$ python
Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.