読者です 読者をやめる 読者になる 読者になる

pirosikick's diary

君のハートにunshift

Mac OS XへのOpenCVインストールとの格闘 その2

http://d.hatena.ne.jp/pirosikick/20100116/1263660823:前回の手順ではやはり失敗していたみたいなのでやり直しますwww
今回参考にしたドキュメントは以下です。
http://www.vogue.is.uec.ac.jp/~den/OpenCVForMac.txt
日本語でわかりやすい上にサンプルコードの実行まで書いてます。

1.Finkで必要なパッケージをインストール

OpenCVインストールには以下のパッケージが必要なようです。

  • pkgconfig
  • libjpeg
  • giflib
  • libpng3
  • libtiff
  • gtk+2-dev
  • glib2-dev
  • atk1

下の3つはなぜかインストール出来なかった(というかダウンロードに失敗していた感じ。なんども別のミラーを参照しようとしてたし。。。)

2.ソースのダウンロード

↓ソースの場所
http://sourceforge.net/projects/opencvlibrary/
今回は「OpenCV-2.0.0.tar.bz2」をダウンロード。
↓tarコマンドで解凍します。

# 何気に初めて使う jxf オプションw
$ tar jxf OpenCV-2.0.0.tar.bz2

3.「./configure」

オプションの意味がイマイチわからんがとりあえず真似してやってみる

$ cd OpenCV-2.0.0
$ ./configure --prefix=/sw LDFLAGS=-L/sw/lib CPPFLAGS=-I/sw/include

4.「make」

エラー。コンパイルは嫌いだわ、

highgui/cvcap_qt.cpp:76: error: ‘Movie’ does not name a type
highgui/cvcap_qt.cpp: In function ‘CvCapture_QT_Movie* icvCaptureFromFile_QT(const char*)’:
highgui/cvcap_qt.cpp:104: error: ‘EnterMovies’ was not declared in this scope
highgui/cvcap_qt.cpp: In function ‘int icvOpenFile_QT_Movie(CvCapture_QT_Movie*, const char*)’:
highgui/cvcap_qt.cpp:143: error: ‘ClearMoviesStickyError’ was not declared in this scope
highgui/cvcap_qt.cpp:146: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:162: error: ‘kQTPOSIXPathStyle’ was not declared in this scope
highgui/cvcap_qt.cpp:162: error: ‘QTNewDataReferenceFromFullPathCFString’ was not declared in this scope
highgui/cvcap_qt.cpp:170: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:170: error: ‘newMovieActive’ was not declared in this scope
highgui/cvcap_qt.cpp:170: error: ‘newMovieAsyncOK’ was not declared in this scope
highgui/cvcap_qt.cpp:171: error: ‘NewMovieFromDataRef’ was not declared in this scope
highgui/cvcap_qt.cpp:191: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:191: error: ‘nextTimeMediaSample’ was not declared in this scope
highgui/cvcap_qt.cpp:191: error: ‘nextTimeEdgeOK’ was not declared in this scope
highgui/cvcap_qt.cpp:192: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
highgui/cvcap_qt.cpp:206: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:213: error: ‘GetMoviesError’ was not declared in this scope
highgui/cvcap_qt.cpp:214: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:214: error: ‘GetMovieBox’ was not declared in this scope
highgui/cvcap_qt.cpp:219: error: ‘QTNewGWorld’ was not declared in this scope
highgui/cvcap_qt.cpp:221: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:221: error: ‘SetMovieGWorld’ was not declared in this scope
highgui/cvcap_qt.cpp: In function ‘int icvClose_QT_Movie(CvCapture_QT_Movie*)’:
highgui/cvcap_qt.cpp:244: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:248: error: ‘DisposeGWorld’ was not declared in this scope
highgui/cvcap_qt.cpp:249: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:249: error: ‘DisposeMovie’ was not declared in this scope
highgui/cvcap_qt.cpp: In function ‘double icvGetProperty_QT_Movie(CvCapture_QT_Movie*, int)’:
highgui/cvcap_qt.cpp:265: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:282: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:282: error: ‘GetMovieTimeScale’ was not declared in this scope
highgui/cvcap_qt.cpp:287: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:287: error: ‘GetMovieDuration’ was not declared in this scope
highgui/cvcap_qt.cpp:301: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:301: error: ‘GetMovieDuration’ was not declared in this scope
highgui/cvcap_qt.cpp:302: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:302: error: ‘GetMovieTimeScale’ was not declared in this scope
highgui/cvcap_qt.cpp: In function ‘int icvSetProperty_QT_Movie(CvCapture_QT_Movie*, int, double)’:
highgui/cvcap_qt.cpp:332: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:352: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:352: error: ‘GetMovieTimeScale’ was not declared in this scope
highgui/cvcap_qt.cpp:357: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:357: error: ‘GetMovieDuration’ was not declared in this scope
highgui/cvcap_qt.cpp:371: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:371: error: ‘nextTimeStep’ was not declared in this scope
highgui/cvcap_qt.cpp:372: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
highgui/cvcap_qt.cpp:373: error: ‘GetMoviesError’ was not declared in this scope
highgui/cvcap_qt.cpp:386: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:386: error: ‘nextTimeStep’ was not declared in this scope
highgui/cvcap_qt.cpp:387: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
highgui/cvcap_qt.cpp:388: error: ‘GetMoviesError’ was not declared in this scope
highgui/cvcap_qt.cpp:409: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:409: error: ‘nextTimeStep’ was not declared in this scope
highgui/cvcap_qt.cpp:410: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
highgui/cvcap_qt.cpp:411: error: ‘GetMoviesError’ was not declared in this scope
highgui/cvcap_qt.cpp: In function ‘int icvGrabFrame_QT_Movie(CvCapture_QT_Movie*)’:
highgui/cvcap_qt.cpp:442: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:450: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:450: error: ‘SetMovieTimeValue’ was not declared in this scope
highgui/cvcap_qt.cpp:451: error: ‘GetMoviesError’ was not declared in this scope
highgui/cvcap_qt.cpp:459: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:459: error: ‘GetMovieTime’ was not declared in this scope
highgui/cvcap_qt.cpp:463: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:463: error: ‘nextTimeStep’ was not declared in this scope
highgui/cvcap_qt.cpp:463: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
highgui/cvcap_qt.cpp: In function ‘const void* icvRetrieveFrame_QT_Movie(CvCapture_QT_Movie*, int)’:
highgui/cvcap_qt.cpp:485: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:495: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:495: error: ‘UpdateMovie’ was not declared in this scope
highgui/cvcap_qt.cpp:496: error: ‘GetMoviesError’ was not declared in this scope
highgui/cvcap_qt.cpp:504: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
highgui/cvcap_qt.cpp:504: error: ‘MoviesTask’ was not declared in this scope
highgui/cvcap_qt.cpp:516: error: ‘GetGWorldPixMap’ was not declared in this scope
highgui/cvcap_qt.cpp:517: error: ‘LockPixels’ was not declared in this scope
highgui/cvcap_qt.cpp:518: error: ‘GetPixBaseAddr’ was not declared in this scope
highgui/cvcap_qt.cpp:518: error: ‘GetPixRowBytes’ was not declared in this scope
highgui/cvcap_qt.cpp:524: error: ‘UnlockPixels’ was not declared in this scope
highgui/cvcap_qt.cpp: At global scope:
highgui/cvcap_qt.cpp:557: error: ‘SeqGrabComponent’ does not name a type
highgui/cvcap_qt.cpp:558: error: ‘SGChannel’ does not name a type
highgui/cvcap_qt.cpp:561: error: ‘ImageSequence’ does not name a type
highgui/cvcap_qt.cpp: In function ‘CvCapture_QT_Cam* icvCaptureFromCam_QT(int)’:
highgui/cvcap_qt.cpp:591: error: ‘EnterMovies’ was not declared in this scope
highgui/cvcap_qt.cpp: At global scope:
highgui/cvcap_qt.cpp:854: error: ‘SGChannel’ was not declared in this scope
highgui/cvcap_qt.cpp:854: error: expected primary-expression before ‘raw_data’
highgui/cvcap_qt.cpp:854: error: expected primary-expression before ‘long’
highgui/cvcap_qt.cpp:854: error: expected primary-expression before ‘long’
highgui/cvcap_qt.cpp:854: error: expected primary-expression before ‘long’
highgui/cvcap_qt.cpp:854: error: expected primary-expression before ‘,’ token
highgui/cvcap_qt.cpp:854: error: expected primary-expression before ‘short’
highgui/cvcap_qt.cpp:854: error: expected primary-expression before ‘long’
highgui/cvcap_qt.cpp:854: error: initializer expression list treated as compound expression
highgui/cvcap_qt.cpp:855: error: expected ‘,’ or ‘;’ before ‘{’ token
make[1]: *** [lib_highgui_la-cvcap_qt.lo] Error 1
make: *** [install-recursive] Error 1

とりあえず調べますかねー
学生時代から「./configure → make → make install」がトラウマですw

んじゃまた書きますー