OpenCVインストール手順〜Debian編(Debian 2.6.26-17lenny2)〜
下準備としてOpenCVインストールに必要なパッケージを入れる
$ sudo apt-get install g++ $ sudo apt-get install debhelper libgtk2.0-dev $ sudo apt-get install python-dev python-support quilt swig zlib1g-dev
Macの時と同じファイルであるOpenCV1.1preをSourceForgeから落としてくる
http://sourceforge.net/projects/opencvlibrary/files/
$ sudo wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/1.1pre1/opencv-1.1pre1.tar.gz/download
解凍する
$ tar zxfv opencv-1.1pre1.tar.gz
configureの設定
$ ./configure --with-python CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" General configuration ================================================ Compiler: g++ CXXFLAGS: DEF_CXXFLAGS: -Wall -fno-rtti -pipe -O3 -g -march=i686 -ffast-math -fomit-frame-pointer -msse2 PY_CXXFLAGS: -Wall -pipe -O3 -g -march=i686 -ffast-math -fomit-frame-pointer -msse2 OCT_CXXFLAGS: -fno-strict-aliasing -Wall -Wno-uninitialized -pipe -O3 -g -march=i686 -ffast-math -fomit-frame-pointer -msse2 Install path: /usr/local HighGUI configuration ================================================ Windowing system -------------- Use Carbon / Mac OS X: no Use gtk+ 2.x: yes Use gthread: yes Image I/O --------------------- Use ImageIO / Mac OS X: no Use libjpeg: yes Use zlib: yes Use libpng: yes Use libtiff: yes Use libjasper: yes Use libIlmImf: no Video I/O --------------------- Use QuickTime / Mac OS X: no Use xine: no Use gstreamer: no Use ffmpeg: yes Use dc1394 & raw1394: no Use v4l: yes Use v4l2: yes Use unicap: no Wrappers for other languages ========================================= SWIG Python yes Octave no Additional build settings ============================================ Build demo apps yes
エラーが出ていないのを確認
Macとの違いはgtk2を使ってることと、Video I/Oにffmpegを使ってること。
次はmake
$ make
インストール
$ sudo make install
必要なリンクを作成
$ ldconfig
$ sudo sh ./build_all.sh
コンパイルが終わったらサンプルを実行してみる
$ ./image