2015年8月14日金曜日

Raspberry Pi 2 で OpenCV 2.4.11 をビルドした

久しぶりに更新
2.4.10に関してはここ

8/17 追記
3/4に 
Raspberry Pi 2 で OpenCV 2.4.11 をビルドした
というメモを書いていたのをすっかり忘れている
前回は、オプションの設定をccmakeで手動で行っているが、今回は引数で設定している
今回はtbbでトラブルことはなかった



最初にraspberry piを更新しておく

sudo rpi-update
sudo apt-get update
sudo apt-get upgrade

ホストPCでOpenCV2.4.11のソースをダウンロードし、展開して外付けHDDにコピー

USB HDDをRaspberry Pi 2に接続し、2.4.11のフォルダーにbuildpi2を作成し、cd buildpi2

OpenCVに必要なファイルは、2.4.10のときにインストールしているので、今回は何もしない

コンフィグレーションを設定

cmake -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_VFPV3=ON -DENABLE_NEON=ON -DBUILD_DOCS=OFF -DBUILD_TESTS=off -DBUILD_PERF_TESTS=OFF -DBUILD_TBB=ON -DBUILD_opencv_apps=OFF -DBUILD_opencv_gpu=OFF -DWITH_OPENCL=off -DWITH_1394=off -DWITH_CUDA=OFF -DWITH_CUFFT=OFF -DWITH_GIGEAPI=OFF -DWITH_OPENCLAMDBLAS=off -DWITH_OPENCLAMDFFT=off -DWITH_TBB=ON ..

raspberry piではOpenCLがサポートされていないのでoffにしている

time make -j4でビルドを行う

real    51m17.127s
user    177m0.210s
sys    5m48.860s

以上

以下は、コンフィグレーション情報

General configuration for OpenCV 2.4.11 =====================================
  Version control:               unknown

  Platform:
    Host:                        Linux 3.18.11-v7+ armv7l
    CMake:                       2.8.9
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               RELEASE

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                /usr/bin/c++  (ver 4.6.3)
    C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfpu=neon -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfpu=neon -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/gcc
    C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfpu=neon -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfpu=neon -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):    
    Linker flags (Debug):      
    Precompiled headers:         YES

  OpenCV modules:
    To be built:                 core flann imgproc highgui features2d calib3d ml nonfree objdetect video contrib legacy photo python stitching superres ts videostab
    Disabled:                    gpu world
    Disabled by dependency:      -
    Unavailable:                 androidcamera dynamicuda java ocl viz

  GUI:
    QT:                          NO
    GTK+ 2.x:                    YES (ver 2.24.10)
    GThread :                    YES (ver 2.40.0)
    GtkGlExt:                    NO
    OpenGL support:              NO
    VTK support:                 NO

  Media I/O:
    ZLib:                        /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.7)
    JPEG:                        libjpeg (ver 62)
    PNG:                         /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.2.49)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)

  Video I/O:
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      NO
      codec:                     NO
      format:                    NO
      util:                      NO
      swscale:                   NO
      gentoo-style:              NO
    GStreamer:                   NO
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    UniCap:                      NO
    UniCap ucil:                 NO
    V4L/V4L2:                    NO/YES
    XIMEA:                       NO
    Xine:                        NO

  Other third-party libraries:
    Use IPP:                     NO
    Use Eigen:                   YES (ver 3.1.0)
    Use TBB:                     YES (ver 4.3 interface 8002)
    Use OpenMP:                  NO
    Use GCD                      NO
    Use Concurrency              NO
    Use C=:                      NO
    Use Cuda:                    NO
    Use OpenCL:                  NO

  Python:
    Interpreter:                 /usr/bin/python2 (ver 2.7.3)
    Libraries:                   /usr/lib/libpython2.7.so (ver 2.7.3)
    numpy:                       /usr/lib/pymodules/python2.7/numpy/core/include (ver 1.6.2)
    packages path:               lib/python2.7/dist-packages

  Java:
    ant:                         NO
    JNI:                         NO
    Java tests:                  NO

  Tests and samples:
    Tests:                       NO
    Performance tests:           NO
    C/C++ Examples:              NO

  Install path:                  /usr/local


0 件のコメント:

コメントを投稿