LoginSignup
49
47

More than 5 years have passed since last update.

OpenCV 3.0がリリースされたので導入してみた

Last updated at Posted at 2015-06-05

OpenCV3.0

主に追加された機能

  • ~1500 patches, submitted as PR @ github. All our patches go the same route.
  • opencv_contrib リポジトリの追加。たくさんの新しい機能が追加された。
  • フリーで使えるa subset of Intel IPP (IPPCV)
  • T-API (transparent API) の導入
  • ~40 OpenCV 関数の高速化
  • OpenCV HAL layer
  • 整理された API (features2d, calib3d, objdetect etc.)
  • 大きな改善 Python & Java bindings
  • 新しく Matlab bindings のα版導入
  • Android support の改善
  • WinRT supportの大きな改善(video capturing and multi-threading capabilities)

GSoC2013と2014のプロジェクト

  • text detection
  • many computational photography algorithms (HDR, inpainting, edge-aware filters, superpixels, …)
  • tracking and optical flow algorithms
  • new features, including line descriptors, KAZE/AKAZE
  • general use optimization (hill climbing, linear programming)
  • greatly improved Python support, including Python 3.0 - support, many new tutorials & samples on how to use OpenCV with Python.
  • 2d shape matching module and 3d surface matching module
  • RGB-D module
  • VTK-based 3D visualization module etc.

他のコントリビューション

  • biologically inspired vision module
  • DAISY features, LATCH descriptor, improved BRIEF
  • image registration module etc.

システム環境

  • Windows 8.1
  • Visual Studio 2013
  • CMake

準備

  • OpenCV3.0のダウンロードはこちら
  • CMakeが必要なので、持ってない方はこちら
  • 他のモジュールプログラムはこちら

※2015年6月4日にダウンロードしたものを用いた、特にモジュールについては随時更新されるので内容が異なる場合がある。

インストール手順

  1. OpenCV3.0のダウンロードが済んだら、opencv-3.0.0.exeファイルを実行し、ファイルを展開(例 C:\opencv300)する。
  2. モジュール(opencv_contrib-master)をダウンロードし適当な場所に解凍する。modulesフォルダの中身をコピーし、C:opencv300\build\modulesにペーストする
  3. CMakeを起動し、ソースフォルダC:/opencv300/sourcesとビルドフォルダC:/opencv300/buildを指定しConfigure(コンパイラはVisual Studio 2013)する。
  4. OPENCV_EXTRA_MODULES_PATHにC:/opencv300/build/modulesを指定する
  5. GenerateするとOpenCV.slnができる。
  6. Visual Studio 2013でOpenCV.slnを開き、debugとreleaseをそれぞれビルドすればbinとlibファイルが生成されるので、C:\opencv300\build\x86\vc12\bin\, C:\opencv300\build\x86\vc12\lib\にそれぞれコピペする
  7. システム環境パスの設定(下表)
  8. Visual Studio 2013の起動とプログラム作成 (インクルードやプロパティの設定忘れずに)
変数
OPENCV_DIR C:\opencv300\
OPENCV_VER 300
Path $(OPENCV_DIR)\build\x86\vc12\bin

※build\includeにopencv_lib.hppを作っておくと便利
※C:/opencv300/build/modulesの中身をbuild/include/opencv2へコピーして用いている

// バージョン取得
#define CV_VERSION_STR CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION)

// ビルドモード
#ifdef _DEBUG
#define CV_EXT_STR "d.lib"
#else
#define CV_EXT_STR ".lib"
#endif

#pragma comment(lib, "opencv_bgsegm" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_bioinspired" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_calib3d" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_ccalib" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_core" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_datasets" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_face" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_features2d" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_flann" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_hal" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_highgui" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_imgcodecs" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_imgproc" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_latentsvm" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_line_descriptor" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_ml" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_objdetect" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_optflow" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_photo" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_reg" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_rgbd" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_saliency" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_shape" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_stitching" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_superres" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_surface_matching" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_text" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_tracking" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_video" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_videoio" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_videostab" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_viz" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_world" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_xfeatures2d" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_ximgproc" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_xobjdetect" CV_VERSION_STR CV_EXT_STR)
#pragma comment(lib, "opencv_xphoto" CV_VERSION_STR CV_EXT_STR)
  • VIZやRGBDモジュールを用いる例はこちら
49
47
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
49
47