Build OpenCV under iOS

Source: Internet
Author: User
Tags install homebrew

If you want to compile OpenCV under iOS you need to install cmake here by homebrew to install CMake

Open Terminal under iOS and install Homebrew first: (with Ruby on Mac)

Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then install CMake:



After you install the CMake, you can use git to download the OpenCV source code is the following:

git clone https://github.com/Itseez/opencv.git

The following is the official website of the compilation steps, according to compile, now can be compiled successfully.
But it may take a long time.
Website compile:
----------------------------------------------------------
Building OpenCV from Source, using CMake and Command line
    1. Make symbolic link for Xcode OpenCV build scripts find the compiler, header files etc.

      Cd/sudo ln-s/applications/xcode.app/contents/developer Developer
    2. Build OpenCV Framework:

      CD ~/<my_working_directory>python opencv/platforms/ios/build_framework.py iOS

If everything ' s fine, a few minutes later you'll get ~/<my_working_directory>/ios/opencv2.framework. You can add the this framework to your Xcode projects.

================================================

Enter the OpenCV directory to find the iOS directory after compilation is complete

The iOS directory will have a compiled OpenCV dynamic library Opencv2.framework

There is also a build directory in the build directory that is a static library compiled for each CPU schema:

Build-arm64-iphoneos

Build-armv7-iphoneos

Build-armv7s-iphoneos

Build-i386-iphonesimulator

Build-x86_64-iphonesimulator

---------------------------------------

I am directly compiling the static library under the Arm64 directory into the arm64 directory

You can use Xcode to open opencv.xcodeproj directly using Xcode to compile OpenCV static libraries for arm64

After the compilation is successful, the corresponding static library and header files can be found in the install directory under this directory.

Lib and include are directly available in the Xcode project.

It seems that the OPENCV is not too complex to use.

--------------------------------------------------------------------------

Reference: http://www.cnblogs.com/tonyspotlight/p/4568305.html

Build OpenCV under iOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.