Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nacho4d

macrumors newbie
Original poster
Jul 13, 2008
23
0
Hi

Hey I know there a way like this one:
http://stefanix.net/opencv-in-xcode
which is basically adding the opencv.Framework to the project.
Actually it works pretty well in command line applications.

But when doing the same in cocoa applications, functions like
cvNamedWindow(...);
cvShowImage(...);
does not seem to work very well (the window does not appear)

Does anyone know a way I can make it work?

using cocoa buttons + opencv windows for showing my results would be great I think.
 

damakable

macrumors newbie
Jul 22, 2009
2
0
I'm no expert on this but here's an open-source project that claims to integrate OpenCV with Core Video:

http://wiki.buzamoto.com/cv_opencv

I tried it and it seems to work well.

I suppose it's likely that commands to open windows etc. may not be cross-platform in OpenCV, but I can only speculate. CVOCV provides a window with three views and an interface to a "processor" class where you can put all your actual image-processing code. Should be suitable for a variety of things. :)
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
using cocoa buttons + opencv windows for showing my results would be great I think.

This is most likely very difficult if not impossible using HighGUI, the part of opencv that is used for displaying windows. It does not provide any access to the OS's native window object, which you would need to add buttons, etc. to it. In fact the documentation specifically says to use your platform's native GUI environment if you want to do anything beyond displaying simple windows with images in them.

The easiest thing to do would be to use opencv for your image processing or whatever, and then convert the IplImages or CvMats that you get into NSImages for display in a normal Cocoa GUI.
 

damakable

macrumors newbie
Jul 22, 2009
2
0
The easiest thing to do would be to use opencv for your image processing or whatever, and then convert the IplImages or CvMats that you get into NSImages for display in a normal Cocoa GUI.

Thanks for clarifying that. That's exactly what CVOCV does, so you can look at that for a good example of how to convert images between the camera buffer, NSImages and IplImages, as well as how to integrate OpenCV with a GUI built in the Interface Builder.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.