2
2

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 3 years have passed since last update.

AndroidStudioにOpenCV_ContribのArUco導入

Posted at

AndroidでARマーカーを使ったアプリを作ることになり、OpenCV_ContribのArUcoを導入することに。
OpenCVとかArUcoについては別記事で書くかも。

ダウンロード

OpenCV_ContribのAndroid版をダウンロードする。
※OpenCVのみだとArUcoがない & Android版じゃないとAndroidStudioでうまく動かないので注意
https://github.com/Mainvooid/opencv-android-sdk-with-contrib
image.png
Download ZIPでダウンロードして、適当なところで解凍する。
私は以下に解凍した。(フォルダ名が重複しちゃってるけど面倒でそのまま)
C:\Program Files\opencv-android-sdk-with-contrib-master\opencv-android-sdk-with-contrib-master

ArUcoをAndroidStudioに取り込む

・メニューバーからFile -> New -> Import Module
・Source directory: には解凍した先のパスを参照するように設定する
・Module name: にはなんのモジュールなのか分かりやすいように名前をつける(今回はopencvとした)
AndroidStudio_OpenCV_1.PNG
画像は設定し終わった後なので押せないが、入力完了したらFinishを押す。
index構築で時間がかかるので終わるまで待機。

・メニューバーから File -> Project Structure
・Modulesにあるappを選択し、Dependenciesタブを表示
・右側にある+ボタンを押す
・3: Module dependencyを選択
・opencvを選択してOKを押す
AndroidStudio_OpenCV_2.PNG
上画面のようになってればOK。

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?