目的
openFrameworksのaddon”ofxFacetraker”をUbuntuで使用する方法について。
いくつか、Knowhowが必要であったため防備録として残す。
ofxFacetraker:
https://github.com/kylemcdonald/ofxFaceTracker
環境
Ubuntu-1404 x64
openFrameworks-0.9.8
OpenCV-3.2
GCC-4.8->GCC-4.9
openFrameworksの導入
UbuntuでopenFrameworksの開発環境を構築する。
openFrameworks本体をダウンロード・解凍する。
wget http://openframeworks.cc/versions/v0.9.8/of_v0.9.8_linux64_release.tar.gz
tar xvfz of_v0.9.8_linux64_release.tar.gz
mv of_v0.9.8_linux64_release of_dev
cd of_dev/scripts/linux/ubuntu
必要なライブラリをインストールする。
sudo ./install_dependencies.sh
sudo ./install_codecs.sh
projectGeneratorをインストールする。
cd of_dev/scripts/linux/
compilePG.sh
cd of_dev/projectGenerator-linux64/
./projectGenerator
ここで、projectGeneratorで、Ubuntu1404標準のGCC4.8でのある場合、
'std::regex_error'エラーが発生する。GCCを4.9へアップデートする。
エラーが発生しない場合は飛ばす。
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo rm /usr/bin/cpp
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.8 10
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.9 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
参考:
Github Issue :Project Generator broken on Ubuntu #4575
Ubuntu 14.04 に GCC 4.9 をインストールする
ADDONをインストールする。
cd of_dev/addons/
git clone https://github.com/kylemcdonald/ofxFaceTracker.git
git clone -b stable https://github.com/kylemcdonald/ofxCv.git
git clone https://github.com/kylemcdonald/ofxTiming.git
学習ファイルを各フォルダにコピーする。
cd of_dev/addons/ofxFaceTracker
./copy-model.py
サンプル"example-empty"をコンパイルする
cd example-empty/
cp ../../../apps/myApps/emptyExample/Makefile .
cp ../../../apps/myApps/emptyExample/config.make .
cp ../../../apps/myApps/emptyExample/emptyExample.qbs .
その他のフォルダも同じようにMakefile、config.make、emptyExample.qbsをコピーする。
コンパイル・実行は以下のコマンドで行う。
make
make RunRelease
参考:
第8回:openFrameworks addonを利用する3:フェイストラッキング – ofxCv, ofxFaceTracker
多摩美 - メディア芸術演習 VI – メディア・アート II 2011
http://yoppa.org/ma2_11/3357.html
cvl-robot's diary ofxFaceTrackerで遊んでみる
http://cvl-robot.hateblo.jp/entry/2016/05/18/185829
Qiita ofxFaceTracker 顔のパーツの座標
http://qiita.com/39_isao/items/9dd0af3bdbe77c5f1080
Qiita 顔をリアルタイムにトラッキングする
http://qiita.com/shu223/items/7846ef33a80a489dff93
ofxFaceTrackerをaddonとして追加する
http://tetsuakibaba.jp/index.php?page=workshop/of/addon