Sunday, October 4, 2009

Using OpenCV2.0 with MacOS 10.6 and XCode 3.2 - PART I

First of all, I'm completely new to programming under MacOS. Some times ago I'tried to develop some IPhone applications but didn't find the time to finish my tasks. With the new OpenCV-Release few days ago I decided to try to install the library on my MacMini. As a posted yesterday the compilation went just fine, but including the library into XCode wasn't as easy as I thought it would be - but after some hours of traial end error I did eventually get the system up an running.

Here is what i've done so far. First of all you should get the newest OpenCV snapshot from the svn server. This is quite simple if you've already installed an svn-client on your mac. If this isn't the case you should first of all install 'fink' and/or 'port' to get native unix applications on your system. After installing one of these packaging systems you have to install more tools. These are:
  • subversion
  • libjpeg
  • libpng
  • libtiff
To install them just open the the 'terminal' an type: 'sudo port -v install subversion libjpeg libpng libtiff' 

After all of these libraries are install you should check out the OpenCV-SVN-folder. This is really simple but takes a while. First create a folder 'OpenCV' and browse there with your terminal. Then all you have to do is type:'svn co https://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/trunk'

Once everything was synchronized between your folder an the svn-server there should be a folder 'trunk/opencv' in your path. There you'll find a sh-skript "make_frameworks.sh" which will configure and compile the OpenCV library as private framework to work with XCode. Just type in the terminal: './make_frameworks.sh'.  


When the skript finally finishes, there should be a file in your folder with the name "OpenCV.framework". This private framework can now be easily be included into XCode.

This is as far as a will go on today. The next time I'll describe how to successfuly integrate the framework into XCode.

No comments:

Post a Comment