Progress

Download Official Build

Some of my code (the imageio work) was integrated back into the mainline of OpenCV. To get a built version of the most recent CVS (28 Oct 2007), download here:

Installation

Installation is very easy from either the source code or using the precompiled binary.

From the Precompiled Universal Binary

  1. Download the precompiled universal binary above.
  2. Mount the disk image by double clicking the icon.
  3. Drag the framework file OpenCV.framework to Macintosh HD > Library > Frameworks.

From OpenCV CVS

  1. Download the CVS source as explained on the sourceforge page:
    cvs -z3 -d:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:/cvsroot/opencvlibrary co -P opencv
  2. Make the universal framework:
    $ cd opencv
    $ ./make_framework.sh
  3. Edit the OpenCV.h header file (optional):
    The OpenCV.h header file is broken because cvaux.h and ml.h are broken. Edit the file OpenCV.framework/Versions/A/Headers/OpenCV.h to contain the lines:
    #ifndef _OPENCV_H_
    #define _OPENCV_H_

    #define CV_NO_BACKWARD_COMPATIBILITY
    #include <OpenCV/cv.h>
    #include <OpenCV/cxcore.h>
    #include <OpenCV/highgui.h>

    #endif /*_OPENCV_H_*/
  4. Drag the framework file OpenCV.framework to Macintosh HD > Library > Frameworks.

Use

The use of a Mac OS X framework is a little different than a traditional UNIX library.

In Linux and Windows OpenCV code you would see the lines: #include <cv.h>

Using a Mac OS X framework, you now specify the framework name followed by the overall header file:

#include <OpenCV/OpenCV.h>

To compile code using the framework, instead of specifying -lcv -I/usr/local/include or similar lines, we can now compile with the line:

$ gcc -framework OpenCV sourcecode.c -o executable