Configure and use opencv on iOS

Source: Internet
Author: User

When using opencv on iOS, you must first install xcode and then download opencv
For IOs: opencv for iOS. Download and decompress it. The following describes the development steps of opencv in IOS.

1) Create an xcode project. Generally, I will create a single view application named helloworld. After the project is created, add opencv2.framework to the project. Click "target", right-click, and select "add files tohelloworld ", in the displayed dialog box, find the opencv2.framework library on your computer, as shown in:

After adding opencv2.framework to the project, modify the pre-compiled header file, that is, the file suffixed with. PCH under the supporting Files folder, and add the following code to the file:

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

This code is added to enable the project to set the functions of opencv in the pre-compilation phase. Therefore, it saves the trouble of import when used in its own code. After setting, you can use opencv in Windows and Linux. However, note that when opencv is used, the suffix of the corresponding file must be included. change m. mm, please note that ,. files in mm format support C ++, otherwise an error will be reported.
Suggestion:

1) Many blog posts on the Internet are relatively old. They will all adopt a 2.2.0 version and use cmake for compilation. In the new version, you do not need to compile it yourself. You can download the corresponding IOS framework from the official website.

2) If you have any questions, ask Baidu and Google frequently. People in the Technical Group have many things to deal.

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.