話題になった時期に試した見たが、文章は放置していたので時期遅れとなった。
caffeの動くマシンで
mkdir deepdream
cd deepdream
caffe用のモデルを取得
wget http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel
deepdream用のipython notebookを取得
git clone https://github.com/google/deepdream
手元でipython notebookが動作する環境がなかったのでpythonのスクリプトを公開している人がいたので取得した
wget http://www.hirotakaster.com/download/dd.py
自分の環境にあわせて変更
中間の状態の表示をカットし、100回適応後の画像をフォルダーに書き出す
CPU環境で実行したので処理速度は遅く、元画像にサイズの大きい画像を選ぶと処理時間が増大するので、1000画素より小さくしている
参考にしたページ
OpenCV、機械学習、はやりのDeep learningの環境構築の方法、サンプルの動かし方、APIの使い方、Tipsなどをすぐに忘れてしまうので、備忘録として記録している。記憶がなくなるスピードが、早いのでメモしておかないと再現できなくなる確率が高まっている。 最近、再度HDDを飛ばしてしまい、過去の自分のページに再度助けられた。 また、DNNモジュールを触る機会が増えているので、C++からPyhonへと鞍替え中。 内容を気にいっていただければ、twitterで紹介願います。
2015年9月2日水曜日
ODROID-XU3 Lite向けにOpenCV2.4.11をビルドした
書きかけで放置していたものだが忘れるといけないのでUPしておく
前回はここ
前回同様にHDDにOpenCV2.4.11のソースを展開しておき、USB HDDを接続すると
/mnt/odroidにマウントされる
opencv2411のフォルダーにmkdir buildodroidを作成し、buildodroidに移動
今回は、
apt-get install libeigen3-devで eigenをインストールしている
すでにraspberry pi2用にビルドしたあとなので、tbbはHDD内に存在している
今回は、ccmakeで指定したtbbのオプションが有効になっているようだ
NEONをONに、GPUは関係ないので外し、あとビルド時間短縮のために不要なものを外している
time cmake -j8 で8コアを指定してビルドしてみる
何か警告が出ている無視
Note: Class Feature2D has more than 1 base class (not supported by Python C extensions)
Bases: cv::FeatureDetector, cv::DescriptorExtractor
Only the first base class will be used
real 12m17.741s
user 69m20.115s
sys 5m56.840s
以上
2015年8月26日水曜日
OpenCV2.4.12.1がリリースされた
公式にはアナウンスされていないがひっそりとOpenCV 2.4.12.1がリリースされている
これまでソースは、sourceforgeからダウンロードしたが、方針の変更によりGitHubからダウンロードする事になった。
ダウンロードのページ
最新のコミットは、12日前(8/16時点)
リリースノートが無いため、2.4.11との変更点は不明である
時間があれば軽く差分を見てみる予定
ちなみに2.4.12は、28日前なので、わずか2週間で修正版がリリースされたことになる
まだ、ソースしか提供されていないので、Windowsでは、自分でビルドしないといけない
すでに2.4.13も予定されている
これまでソースは、sourceforgeからダウンロードしたが、方針の変更によりGitHubからダウンロードする事になった。
ダウンロードのページ
最新のコミットは、12日前(8/16時点)
リリースノートが無いため、2.4.11との変更点は不明である
時間があれば軽く差分を見てみる予定
ちなみに2.4.12は、28日前なので、わずか2週間で修正版がリリースされたことになる
まだ、ソースしか提供されていないので、Windowsでは、自分でビルドしないといけない
すでに2.4.13も予定されている
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
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
2015年3月19日木曜日
Windows版 OpenCV 2.4.11のConfigurationを表示してみた
デフォルトで提供されているWindows版の2.4.11のコンフィグレーションを表示させてみた
TBBがONになっていないのは何気にいたい
(顔検出はTBBがONになっているとコア数分並列で計算されるので効果が大きい)
独自のベンチを試してみたらUbuntuのTBB ONのバージョンと時間はほぼ同じであった
ConcurrencyがONになっているので、並列計算が有効になっていると思われる
General configuration for OpenCV 2.4.11 =====================================
Version control: 2.4.11
Platform:
Host: Windows 6.1 AMD64
CMake: 2.8.11.2
CMake generator: Visual Studio 12 Win64
CMake build tool: C:/PROGRA~2/MSBuild/12.0/Bin/MSBuild.exe
MSVC: 1800
OpenCV modules:
To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib stitching superres ts videostab
Disabled: java python world
Disabled by dependency: -
Unavailable: androidcamera dynamicuda viz
Windows RT support: NO
GUI:
QT: NO
Win32 UI: YES
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.7)
JPEG: build (ver 62)
PNG: build (ver 1.5.12)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
Video I/O:
Video for Windows: YES
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 55.18.102)
format: YES (ver 55.12.100)
util: YES (ver 52.38.100)
swscale: YES (ver 2.3.100)
gentoo-style: YES
OpenNI: NO
OpenNI PrimeSensor Modules: NO
PvAPI: NO
GigEVisionSDK: NO
DirectShow: YES
Media Foundation: NO
XIMEA: NO
Intel PerC: NO
Other third-party libraries:
Use IPP: NO
Use Eigen: NO
Use TBB: NO
Use OpenMP: NO
Use GCD NO
Use Concurrency YES
Use C=: NO
Use Cuda: NO
Use OpenCL: YES
OpenCL:
Version: dynamic
Include path: C:/builds/2_4_PackSlave-win64-vc12-shared/opencv/3rdparty/include/opencl/1.2 C:/Program Files (x86)/AMD/clAmdFft/include C:/Program Files (x86)/AMD/clAmdBlas/include
Use AMD FFT: YES
Use AMD BLAS: YES
Python:
Interpreter: C:/Python27-x64/python.exe (ver 2.7.5)
Java:
ant: C:/Program Files (x86)/apache-ant/bin/ant.bat (ver 1.9.2)
JNI: C:/Program Files/Java/jdk1.6.0_45/include C:/Program Files/Java/jdk1.6.0_45/include/win32 C:/Program Files/Java/jdk1.6.0_45/include
Java tests: NO
Tests and samples:
Tests: NO
Performance tests: NO
C/C++ Examples: NO
(顔検出はTBBがONになっているとコア数分並列で計算されるので効果が大きい)
独自のベンチを試してみたらUbuntuのTBB ONのバージョンと時間はほぼ同じであった
ConcurrencyがONになっているので、並列計算が有効になっていると思われる
General configuration for OpenCV 2.4.11 =====================================
Version control: 2.4.11
Platform:
Host: Windows 6.1 AMD64
CMake: 2.8.11.2
CMake generator: Visual Studio 12 Win64
CMake build tool: C:/PROGRA~2/MSBuild/12.0/Bin/MSBuild.exe
MSVC: 1800
OpenCV modules:
To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib stitching superres ts videostab
Disabled: java python world
Disabled by dependency: -
Unavailable: androidcamera dynamicuda viz
Windows RT support: NO
GUI:
QT: NO
Win32 UI: YES
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.7)
JPEG: build (ver 62)
PNG: build (ver 1.5.12)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
Video I/O:
Video for Windows: YES
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 55.18.102)
format: YES (ver 55.12.100)
util: YES (ver 52.38.100)
swscale: YES (ver 2.3.100)
gentoo-style: YES
OpenNI: NO
OpenNI PrimeSensor Modules: NO
PvAPI: NO
GigEVisionSDK: NO
DirectShow: YES
Media Foundation: NO
XIMEA: NO
Intel PerC: NO
Other third-party libraries:
Use IPP: NO
Use Eigen: NO
Use TBB: NO
Use OpenMP: NO
Use GCD NO
Use Concurrency YES
Use C=: NO
Use Cuda: NO
Use OpenCL: YES
OpenCL:
Version: dynamic
Include path: C:/builds/2_4_PackSlave-win64-vc12-shared/opencv/3rdparty/include/opencl/1.2 C:/Program Files (x86)/AMD/clAmdFft/include C:/Program Files (x86)/AMD/clAmdBlas/include
Use AMD FFT: YES
Use AMD BLAS: YES
Python:
Interpreter: C:/Python27-x64/python.exe (ver 2.7.5)
Java:
ant: C:/Program Files (x86)/apache-ant/bin/ant.bat (ver 1.9.2)
JNI: C:/Program Files/Java/jdk1.6.0_45/include C:/Program Files/Java/jdk1.6.0_45/include/win32 C:/Program Files/Java/jdk1.6.0_45/include
Java tests: NO
Tests and samples:
Tests: NO
Performance tests: NO
C/C++ Examples: NO
Windows10 テクニカルプレビュー 64bit版にOpenCV 2.4.11の開発環境を構築した
検索などでこのページを訪れる人が、数は少ないけど、コンスタントにいる。
ちょうどこの上にあるG+1のボタンを押してもらうと、Goolgeの検索に見つかりやすくなるので、ご協力いただきたい。
久しぶりにwindws版を設定した。基本いつもと同じであるが、以後対象を64bitを前提に記す。
Windows版は、tbb、OpenGL、OpenNI、CUDAを使用しなければ、ダウンロードしたファイルを展開して設定すれば使用できるので、30分もかからず環境ができる。
(ダウンロード時間や、Visual Studio Community 2013のインストールを除く)
1 ここからWindows版をダウンロードする
ダウンロードサイズは350Mバイト
2 OpenCV-2.4.11.exeを実行しインストールディレクトリc:\を指定する
3 展開後、ディレクトリ名をopencvからopencv2411に変更する
4 OSの環境変数の設定(要管理者権限)
コントロールパネル、システムとセキュリティ、システムを開き
システムの詳細設定の環境変数ボタンを押し
システム環境変数のPathの編集
末尾に";C:\opencv2411\build\x64\vc12\bin"を追加
(この作業後、一度サインオフし、再度サインインする)
5 Visual Studio 2013 Communityのプロパティファイルを作成する
以後のテキストをコピーし、ファイル名OpenCV2411_64.props などのファイル名を付けて任意のフォルダーに保存する
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>C:\opencv2411\build\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup>
<LibraryPath>C:\opencv2411\build\x64\vc10\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
6 Visual Studio 2013 Communityのプロパティファイルの設定を行う
新規プロジェクトを作成し、viewのメニューから、Other Windows Property Managerを選択
property windowを表示し、Debug x64と Relearse x64に先ほどのファイルを追加する
7 手持ちのサンプルをmainにコピーしビルドし動作を確認する
以上
ちょうどこの上にあるG+1のボタンを押してもらうと、Goolgeの検索に見つかりやすくなるので、ご協力いただきたい。
久しぶりにwindws版を設定した。基本いつもと同じであるが、以後対象を64bitを前提に記す。
Windows版は、tbb、OpenGL、OpenNI、CUDAを使用しなければ、ダウンロードしたファイルを展開して設定すれば使用できるので、30分もかからず環境ができる。
(ダウンロード時間や、Visual Studio Community 2013のインストールを除く)
1 ここからWindows版をダウンロードする
ダウンロードサイズは350Mバイト
2 OpenCV-2.4.11.exeを実行しインストールディレクトリc:\を指定する
3 展開後、ディレクトリ名をopencvからopencv2411に変更する
4 OSの環境変数の設定(要管理者権限)
コントロールパネル、システムとセキュリティ、システムを開き
システムの詳細設定の環境変数ボタンを押し
システム環境変数のPathの編集
末尾に";C:\opencv2411\build\x64\vc12\bin"を追加
(この作業後、一度サインオフし、再度サインインする)
5 Visual Studio 2013 Communityのプロパティファイルを作成する
以後のテキストをコピーし、ファイル名OpenCV2411_64.props などのファイル名を付けて任意のフォルダーに保存する
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>C:\opencv2411\build\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup>
<LibraryPath>C:\opencv2411\build\x64\vc10\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
6 Visual Studio 2013 Communityのプロパティファイルの設定を行う
新規プロジェクトを作成し、viewのメニューから、Other Windows Property Managerを選択
property windowを表示し、Debug x64と Relearse x64に先ほどのファイルを追加する
7 手持ちのサンプルをmainにコピーしビルドし動作を確認する
以上
2015年3月4日水曜日
Raspberry Pi 2でOpenCV 2.4.11をビルドした
2.4.10の記事はここ
ccmakeによるパラメータの設定
1 コンパイラの変更
/usr/bic/gcc-4.8
/usr/bin/g++-4.8
ここで一旦cを押しconfigureを行う
注意
コンパイラを変えるとコンパイラ以外のすべての設定がデフォルトに戻るので再度指定する必要がある。
2 tbbの設定
ccamkeでtbb=onにして、
cを押しconfigureを行うと、tbbソースのダウンロードに失敗しているようである。
そこで一旦ccmakeを抜け、
wget https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141204oss_src.tgz
により手動での取得を試みるがエラーが生じる
ERROR: The certificate of `www.threadingbuildingblocks.org' is not trusted.
ERROR: The certificate of `www.threadingbuildingblocks.org' hasn't got a known issuer.
certificationを登録しないで、取得するには以下のようにする
wget --no-check-certificate https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141204oss_src.tgz
ダウンロードしたファイルは、
3rdparty/tbbにコピーしておく
(ここに0バイトの残骸が残っているので、上書きする)
3 再度ccmake を起動し、残りのパラメータを設定
cを押しconfigureし、gによりgenarateを行う
ccmakeを終了し、time make -j4でビルドする
real 50m51.860s
user 173m49.150s
sys 5m43.170s
4 インストール
sudo make install
sudo ldconfig
以上
登録:
投稿 (Atom)



