A continuation of the port of OpenCV to Mac OS X.
Morgan Conbere :: October 2007
$ ./configure --enable-universal
$ make framework
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:
OpenCV.framework
to Macintosh HD > Library > Frameworks
.
cvs -z3 -d:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:/cvsroot/opencvlibrary co -P opencv
$ cd opencv
$ ./make_framework.sh
OpenCV.h
header file (optional):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_*/
OpenCV.framework
to Macintosh HD > Library > Frameworks
.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