1. Download the latest OpenCV:
Https://github.com/Itseez/opencv
2. Compile OpenCV need cmake, if not, need to install first (install package select Unit/linux Source):
http://www.cmake.org/download/
3. Install CMake:
Unzip the downloaded compressed package, open the terminal and enter its directory. sudo./bootstrap && make && make install. 4. Compile OPENCV:CD Opencv-master/platforms/ios. The storage path for Python build_framework.py opencv2.framework. 5. After the compilation succeeds, the Opencv2.framework is generated in the specified path and then introduced into the desired Xcode project.
6. After the success of the Opencv2.framwork compilation, if the use of Xcode reported in the following image error:
and point to error, the discovery is in the following code:
enum {NO, GAIN, gain_blocks};
This situation needs to modify the source code of OPENCV. The modification method is as follows: For exposure_compensate.hpp errors, the above error code should be revised to
enum {no_exposure_compensator = 0, GAIN, gain_blocks};
Modify the corresponding ' NO ' to ' no_exposure_compensator ' in the exposure_compensate.cpp. The same changes are made to errors in blenders.hpp, and other "expected identifier" errors are similar. After the modification, recompile the OPENCV.