Ask Your Question
0

OpenCV 3.1.0 iOS tutorials/guide?

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

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

Comments

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

1 answer

Sort by ยป oldest newest most voted
0

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

jmbapps gravatar image

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

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>
#endif

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

Stats

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

Seen: 487 times

Last updated: Mar 09 '16