PDA

View Full Version : OpenCV + Objective-C




beon
Dec 17, 2008, 03:05 PM
So, when it comes to using the OpenCV framework (available here (http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port)) in Objective-C, THIS (http://buza.mitplw.com/blog/?p=187) guy says: Surprisingly, this task is incredibly simple. In less than 200 lines of Objective-C, I’ve got a CoreVideo-based OS X application that does blob detection using OpenCV.

Well, that blows my mind, 'cause I can't seem to get it up and running. I add the framework, add a build step to my project target to copy the private framework files... but my compiler balks at the line #import "highgui.h" telling me error: highgui.h: No such file or directory

Which makes me feel like a n00b, which, when it comes to OpenCV, is the truth.

Do any of you out there in MacRumors-Land have any tips, or better yet, any Objective-C code that uses OpenCV?

I'd be real happy, if so...

Much respect,

beOn



Sayer
Dec 17, 2008, 03:29 PM
Typically for frameworks you do:

#import <FrameworkName/HeaderName.h>

beon
Dec 17, 2008, 08:55 PM
D'oh! To the face!

Also, the guy I was talking about (http://buza.mitplw.com/blog/?p=187) pointed me towards this (http://wiki.buzamoto.com/cv_opencv), which is a good example of OpenCV in Objective-C, if anyone ever needs it.

This be solved.

Anyone had any interesting OpenCV experiences?

IntuitiveWorkz
Feb 4, 2009, 02:22 PM
Do you have an example of how you installed opencv?

I'm getting the same error you did but I am using <headername/headerfile.h>

Any thoughts?

Thanks

wittegijt
Feb 4, 2009, 03:16 PM
Do you have an example of how you installed opencv?

I'm getting the same error you did but I am using <headername/headerfile.h>

Any thoughts?

Thanks

There is not much installing it, just add it to your xcode project and add a 'Copy files' buildstep to copy the framework in your app bundle. Since this is a private framework, you can't use it in command line apps.

Wittegijt.