Today I have been trying to figure out installation of OpenCV (a computer vision library) in my laptop. This article explain how I did the setup of OpenCV in Mac OSX (Mavericks).

Pre-requisite: Install CMake

  1. Download CMake build system from the official CMake website. I downloaded it from here:

  2. Install the dmg package and launch it from Applications. That will give you the UI app of CMake

  3. Add cmake command:

    1. Close the CMake app and open it from the terminal with sudo:
      sudo /Applications/
    2. From the CMake app window, choose menu Tools --> Install For Command Line Use. Install folder will be /usr/bin/ by default, submit it by choosing Install command line links.
    3. Make sure it works checking cmake --version.

Installation: OpenCV building from source

Download OpenCV from the official website. I downloaded it from OpenCV 3.0 RC1 for Linux/Mac.

Extract the zip file, copy the folder opencv-3.0.0-rc1 to your projects folder,

mv opencv-3.0.0-rc1 opencv
cd opencv
mkdir build
cd build
make -j4
make install

Thats it, OpenCV is installed on your system. To confirm installation, do import cv from the python terminal:

$ python
    Python 2.7.8 |Anaconda 2.0.1 (x86_64)| (default, Aug 21 2014, 15:21:46)
    [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    Anaconda is brought to you by Continuum Analytics.
    Please check out: and
    >>> import cv

If import cv doesn’t show errors, then the installation is success! Go ahead and write your hello-world opencv app!