Iphone and Opencv

iPhone and OpenCV

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

OpenCV and iOS - Getting started

These are helper methods and best written in a separate file. Quite simply,


  1. Put all that image manipulation code in say ImageManipulationHelper.mm and create a header file for the same

  2. Create a nice little category for UIImage.

which can call these methods in turn to create any image manipulation you might want.

Easy does it. And yeah, read up a bit more on using C++ in objectiveC, if you get into trouble and also about categories. They are some of the niftier features of objectivec

Opencv iOS install

Try installing from either of the repositories brew or macports.

simple IOS code with OpenCV can run on simulator but fail at real device

It's because your opencv2.framework was built with only x86 and x86-64 architectures. You need to either find one that includes armv7, armv7s (for 32-bit iPhones) and arm64 (for iphone 6 and later), or build one from source (see instruction).

iOS Use OpenCV to recognise a building

Detecting known objects such as your building in an image can be done using the features2d module in OpenCV.

It works by detecting key points in the known image and computing a set of descriptors for these that can be compared to the key points and descriptors computed from the unknown scene image by a process known as matching.

The find_obj.py demo in the samples/python2 folder of OpenCV shows how to detect a known object in an image.

There is also a tutorial in the user guide, see http://docs.opencv.org/doc/user_guide/ug_features2d.html

Note that some of the algorithms often used (e.g. SURF and SIFT) are not free, and need to be licensed separately if you use them.

OpenCV and iOS in an iPhone

No open CV is not in objective-c by default so you have to download the library and install it first them develop the app and compile it with the library.

Yes, you can build it as self contained app if you add the framework to the dependencies section in Xcode. Apple will not allow the user to download and install stuff on the iphone each app is downloaded separately.

Related Topics

Leave a reply