tags:

views:

11154

answers:

12
+12  Q: 

iPhone and OpenCV

I know that OpenCV was ported to Mac OS X, however I did not find any info about a port to the iPhone.

I am not a Mac developer, so that I do not know whether a Mac OS X port is enough for the iPhone.

Does anyone know better than me?

Edit: Thanks for the informed answer Adam.

+3  A: 

I haven't tried using OpenCV specifically, but I do dev for the iPhone and can say that most libraries I've tried that work on OS X DO NOT work on the iPhone out of the box. Some of them just needed a little tweaking/configuration to be done and then it was fine on the iPhone, but the reality is that the phone is missing quite a few backend components that OS X supports. Most complex libraries (OpenCV sounds like one of them) aren't going to work without a major effort - particularly since OpenCV sounds like it depends on several other external libraries as well...so those would have to be ported too.

Adam Byram
+2  A: 

Note that OpenCV runs very fast on Intel chips but the iPhone is arm. Of course OpenCV is extremely useful but it won't be that fast. Also, there's no way to get a live video stream on the iPhone so all of the normal potential CV applications sort of lose their appeal, don't they?

z8000
Well, OpenCV can be of interest on photographs also. Actually, there are two apps that can record videos on the IPhone (cycorder and Iphone Video Recorder), even if the resolution of the videos is of course low.
Pascal T.
+11  A: 

OpenCV does indeed work on the iphone. Use the configure script here to compile the library: http://lambdajive.wordpress.com/2008/12/20/cross-compiling-for-iphone/

You just have to cross-compile just as you do your apps.

+4  A: 

Here I explain how to compile a universal static lib with iPhone support. Hope this helps.

A: 

Of course, since iPhone dev won't allow users to utilize the camera video feed for god-knows-what reason it might be a moot point unless you were planning on using it for images. Just something to take into consideration.

Cyprus106
iOS 4 now allows access to the video feed.
Greg Maletic
A: 

Here's modified script (based on the one from LambdaJive) that builds universal OpenCV framework for iPhone/iPhone Simulator - http://zaaghad.blogspot.com/2009/02/universal-i386arm-opencv-framework-for.html

+3  A: 

Here is opencv2.0 on iPhone http://github.com/niw/iphone_opencv_test

Forrest
+2  A: 

iPhone do support OpenCV if you want to use it first go to the best OpenCV on iPhone Documentation on the web: Yoshimasa Niwa's

I used it and i already have an app on the AppStore that uses Face Detection and Image Processing: Flags&Faces if you have any doubts please contact me.

sicario
A: 

Hi,

Can you please send me the code using which you detect the face. I tried several times but not found success in it. Please help me.

Thanks in advance.

Surendra

Surendra
Better post a question showing what code you wrote and how it doesn't work. This would be much more likely to give you useful responses than a "please send me code" request.
sth
A: 

That link that's marked as an answer only works for Iphone OS 3.x and for OpenCV 2.0. Does anyone have any idea on how to port this to work with the latest OpenCV release and iOS4?

Diego
A: 

The following post by Yoshimasa does indeed work with I OS and the IPhone 4 and is able to access both the front and back cameras.

The link to the project is http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en and the sample code is at webgit and it is linked from this article. I really encourage to read the article before getting the source code.

Martin
A: 

All you need is to generate XCode project for OpenCV project using cmake or cmake gui tool. Remember to set option to generate XCode project instead of the default option to use CMakeFiles. Open generated project, change the base SDK to iPhone SDK, and hit build!

Since OpenCV does not support iOS at now (but they has announced iPhone support in version 2.2), highgui library won't compile. So if you need camera access you have to write it yourself.

Anyway, other libraries should compile and work on the device. (Works for me). Good luck!

BloodAxe