1
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iOS用にOpenCVをビルドする方法(opencv2.frameworkの作り方)

Last updated at Posted at 2019-09-20

概要

iOS用にOpenCV公式サイトでopencv2.frameworkが配布されていますが
contribのmoduleを使用したい場合は自分でビルドする必要があります。
探しても古い文献しか見つからなかったので現行バージョンをまとめます。

実行環境

準備

CMake

CMakeをインストールし忘れてエラーになってる人をよく見ます。

brew install cmake

Python

どうインストールしてもよいですが、2系を用意してください。
(2019/9/20段階でOpenCVのビルドスクリプトがPython3に対応していませんでした。)

OpenCV

任意のディレクトリにOpenCVをダウンロード

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

(必要あれば)OpenCV contrib

任意のディレクトリにダウンロード

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

ビルド

下記コマンドでビルドするとoutputDirにopencv2.frameworkが出来ます。

python opencv/platforms/ios/build_framework.py --contrib opencv_contrib outputDir

サンプルプログラム

後ほど追記

まとめ

contribを含めてframeworkを作っておくとSIFTやTrackingなどが簡単に使えるようになります。

1
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?