97

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?

13 Answers 13

51

OpenCV does indeed work on the iphone. Use the configure script here to compile the library: cross compiling for iphone

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

Sign up to request clarification or add additional context in comments.

5 Comments

that method does not work with the recent versions of OpenCV or the recent versions of iOS SDK. The best method is currently "computer-vision-talks.com/2011/02/…"
Take out the /%22 at the end and it does. Try this: computer-vision-talks.com/2011/02/…
Here is precompiled OpenCV 2.3 for iOS: computer-vision-talks.com/download/….
OpenCV is now available as a framework for iOS. Just drag and drop into your project. It supports video capture too. See the article and get the example project here: bit.ly/pTWfOh
@RobinSummerhill : nice link... make this as an answer.
29

OpenCV now (since 2012) has an official port for the iPhone (iOS).

You can find all of OpenCV's releases here.

And find install instructions here:

Tutorials & introduction for the new version 3.x

4 Comments

I have problem in installation, can you have any other tutorial link for installation OpenCV?
Maybe you should present your problem here at stackoverflow if you think it is relevant, or at OpenCV's Q&A site, awnsers.opencv.org
Has anyone tried this recently? I am following these steps but cannot get a successful iOS build.
The link is no longer working, can anyone that knows the updated link please edit this answer
24

The latest build script from Computer Vision Talks works great for Xcode 4 and iOS 4.3 . I have tried the script myself and it is just awesome!

2 Comments

this is a great script - deserves voting up as it's more current than the top one currently (same answer, more current script)
Yes this is currently the best method. Highly recommended!
18

Here is opencv2.0 on iPhone iphone opencv test

1 Comment

I forked it in order to keep it up to date with latest version of OpenCV: github.com/stephanepechard/iphone_opencv_test
17

OpenCV is now available as a framework for iOS. Just drag and drop into your project. It supports video capture too. See the article and get the example project here: opencv framework for ios

For the sake of transparency, I wrote this article and it is hosted on my company's website.

Comments

4

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.

Comments

4

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).

Comments

3

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.

Comments

2

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?

1 Comment

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.
1

You can also install OpenCV using a package manager like Cocoapods.

To quote the installation guide:

You want to add pod 'OpenCV', '~> 3.0' similar to the following to your Podfile:

target 'MyApp' do
    pod 'OpenCV', '~> 3.0' 
end

Then run a pod install inside your terminal, or from CocoaPods.app.

Comments

0

Here's modified script (based on the one from LambdaJive) that builds universal OpenCV framework for iPhone/iPhone Simulator - universal-i386arm opencv framework

Comments

0

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 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.

Comments

0

A project utilizing opencv on the iPhone (Lucas-Kanade optical flow to be exact). Source code available and app is on the AppStore as well -

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.