First, you can run the official recommended OpenCV for IOS samples demo Link: https://github.com/Itseez/opencv_for_ios_book_samples.git
I. Limitations on the development of real machines:
OpenCV Development under iOS, if it involves the camera, need to use the real machine to run, so you need to add a developer account, if it is free, can run 7 times a week (if the funds are limited to register a few more available accounts) General-add an account.
Second, according to official instructions to do but did not succeed
If you set up a project, according to OPENCV official instructions to configure, basically no problem, the only thing to illustrate: OPENCV provides the framework is C and C + + mixed, so in Xcode writing OpenCV also xcode/c++ mixed compilation, If your project in Xcode has both OC Code and C + + code, in the default configuration, it will be reported as:
"Std::__1::__vector_base_common::__throw_length_error () const", referenced From:cv::sparsemat::resizehashtab ( unsigned long) in Opencv2 (MATRIX.O) std::__1::vector>::__append (unsigned long) in Opencv2 (MATRIX.O) Std::__1: : Vector>::__append (unsigned long) in Opencv2 (MATRIX.O)
Wait a bunch of link errors, there are two workarounds:
1. Change a file in the project with a suffix of. m to. mm. Because. mm files can contain C + + code in addition to objective-c and C code;
2. Set the compiler: Locate the project build Settings and set compile source as object-c++ to run.
Two frequently asked questions about OPENCV development configuration under iOS (sign and link)