OpenTouchのビルド手順

マルチタッチを制御するためにいくつかライブラリがあるが
その中のopentouchを使ってみることにした。

opentouch

インストール

svn checkout http://opentouch.googlecode.com/svn/trunk/ opentouch

試しにサンプルを実行していみる。
サンプルにあるBlogbDetecionTestにXcodeのプロジェクトがある。

/src/Examples/BlobDetectionTest/BlobDetectionTest.xcodeproj

が、ビルドするためには

/Library/Frameworks/にOpenCV.framework

がないといけない。
どうやってこのパッケージを持ってくるかといろいろ調査していて
親切に作ってくれているかたがいたのでそこからダウンロード。

ここのページ
http://opencvlibrary.sourceforge.net/Mac_OS_X_OpenCV_Port
これを
http://homepage.mac.com/taweili/OpenCV.framework.zip
をダウンロード。

/Library/Frameworks/

に設置する。

mv ~/Desktop/OpenCV.framework /Library/Frameworks/

サンプルコードのエラーとの格闘
■BlobDetectionTest.xcodeproj
/src/Exsamples/BlobDetectionTest.xcodeproj

エラー

 error: no matching function for call to 'blobDetection::BlobDetection::BlobDetection(int&, int&)'

エラー箇所

blobDetection::BlobDetection theBlobDetection(img->width, img->height);

ソースを追っかけると
BlobDetection.hに

BlobDetection(int imgWidth, int imgHeight, int bytesPerPixel);

と第3引数にbytesPerPixel(ピクセルあたりのバイト数)を指定する必要があるので、とりあえす1を設定。

blobDetection::BlobDetection theBlobDetection(img->width, img->height,1);

ビルドはうまくできた。しかしエラーがでる。不明だ。

Failed to tranform process type:-50

■cvBlobDetection
/src/Examples/cvBlobDetection.xcodeproj

ビルドしたら

error: OpenCV/OpenCV.h: No such file or directory

調べると
#include
と記述があるがそんなファイルないのでコメントアウトした

実行ファイル

/src/Examples/cvBlobDetection/build/Release/TestBlob.app

■portVideoBlobDetection
/src/Examples/portVideoBlobDetection.xcodeproj

依存ライブラリは

SDL.frameworkがないのでここから持ってくる
http://www.libsdl.org/download-1.2.php

http://www.libsdl.org/release/SDL-1.2.13.dmg

SDL.frameworkを/Library/Frameworks/へコピー

問題なくビルド完了!
実行ファイル

/src/Examples/portVideoBlobDetection/build/Release/portVideoBlobDetection.app

インタプリタばかり使っていたのでコンパイルするのは新鮮だった