Home > MacOS, OpenCV > Opencv Test on Xcode

Opencv Test on Xcode

I pre-installed opencv (2.3.1) for python binding, but haven’t tried it out in Xcode. Here’s what I found that works on my Mac. I am using Xcode4.3, Mac Lion 10.7.3.

Just to clarify, I almost followed this link, which turns out working well for the example code.

– Make a new project and choose “Command Line Tool”, choose C++ as the type for the project. Xcode will automatically generate a main.cpp for you.

– Go to project setting, select all, among which search the “Header search path”, and add “/opt/local/include”

– Create a folder for your ‘framework’ on the left panel,  let’s say, name it as “opencv-Frameworks”, and right click it use “Add files to..”. You will going to add three files which are located at </opt/local/lib>. They are: libopencv_ml.2.3.1.dylib, libopencv_highgui.2.3.1.dylib, libopencv_core.2.3.1.dylib

– You don’t have to copy those items, but just an option 🙂

– Now, copy the demo code in the above link to your main.cpp, click build+run, you should see a pop up window like this:

– You can find a completed working project here.

Advertisements
Categories: MacOS, OpenCV Tags: ,
  1. No comments yet.
  1. May 8, 2012 at 7:39 AM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: