Ask Your Question

OpenCV 3.1.0 iOS tutorials/guide?

asked 2016-03-08 05:42:02 -0500

tnrnz gravatar image

Hello, I'm new to the community and as well on iOS programming. I've checked the OpenCV documentation and seems that the iOS section of it is seem vague for me.

I've been searching for any beginner tutorials on google and stackoverflow to no avail. It is why I turn over to here perhaps you guys can give me any material to start with.

edit retag flag offensive close merge delete


berak gravatar imageberak ( 2016-03-08 05:43:59 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-03-08 07:53:22 -0500

jmbapps gravatar image

updated 2016-03-09 09:53:50 -0500

I have not learned Swift and I am not going to. However, this should work as all the C++ is confined to its own file. Swift does not get along with C++. I have a couple of apps in the App Store. This is what I had to do to get it to work with iOS 9 and the latest Apple hurdle...bitcode. Im assuming you are using Xcode as your IDE. Download the prebuilt iOS framework. Add it to your project. Do not add it to the binary section, it wont work. Add a C++ file to your project, leave the .cpp file alone and add the following to your .hpp file.

#ifdef __cplusplus
#import <opencv2/opencv.hpp>

Now add this to your main ViewController

#import "opencvBridging.cpp"
#import <opencv2/imgcodecs/ios.h>

The import opencvBridging.cpp is what I named my C++ file I added, so replace this with your filename. Make sure to change your ViewController.m file to a file. Just click on the name of the file in your Project Navigator (left side up at top) and add the m.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-03-08 05:42:02 -0500

Seen: 366 times

Last updated: Mar 09 '16