« メールス?マース?マーズ?MERSの正しい発音は? | トップページ | OpenCV3を64bitのPython3.4で使う。 »

2015年6月 5日 (金)

OpenCV3.0が正式リリース!ついにPython3をサポート。

とうとうきましたねー。結構かかりましたが、とうとうOpenCVのバージョン3が正式リリースになりました。目玉はPython3のサポートでしょうか。

これはぜひ試してみたいところですが、公式からダウンロードするとファイルのサイズが200MB 超えるとおもうので、いつもの通りgohkeさんのところから非公式のPythonバインディングをとってくるといいと思います。リリースがあったばかりですが、GohlkeさんはすでにOpenCVをアップデートしてました。鬼。いつもほんとに助かります。m(_ _)m

インストール方法

GohlkeさんのところからとってきたPython bindingをPython2.7でOpenCV3をインストールする例をあげます( 「OpenCV3を64bitのPython3.4で使う」も記事にしました)。わたしの場合、Pythonが32ビットなので

opencv_python-2.4.11-cp27-none-win32.whl

をダウンロードしました。拡張子がwhlなので、すでにコンパイルされたバイナリ形式のライブラリのアーカイブでeggが新しくなったものです。whlはつまりwheel、ウィール、日本語表記ではホイールで、車輪のことです。なぜ車輪かというと”車輪の再発明”から来ていると思われます。

wheelは中身は実はZIPファイルなのでもしかしたら普通に解凍できるかもしれませんが、自分でsetup.pyをせずにここはpipを使いましょう。ダウンロード先に移動して、

pip install opencv_python-2.4.11-cp27-none-win32.whl

で解凍して、setup.pyしてという一連のpipインストールの作業が行われます。pipにパスが通ってない場合Python27/Scriptsにあるバズです。


ドキュメンテーションはどこに行った?

今回のアップデートでドキュメンテーションも一新していますが、新しいドキュメンテーションはC++のAPIにしか触れていないのでPythonバインディングのcv2ではどうやったらいいのかわからなくなってしまいました。cv2.SVMがcv2.ml.SVMに移動したりといろいろ変更点もあるようですが、基本的には2.4系と変わらないようなので当面は2.4.11のドキュメンテーションを見ながら行けばいいと思います。

FAQサイトの質問を見ると人出が足りないのでcv2のAPIに関するドキュメンテーションはいつになるやらという感じですね。

help(cv2)

で出てくる大量のヘルプテキストをみるのも手です。

opencv\sources\samples\python2にあるサンプルコードをみるのも手。

バージョン移行のガイドも参考になります。

最後に公式からバージョン2.4系からの変更点をコピペしておきますね。

  • ~1500 patches, submitted as PR @ github. All our patches go the same route.
  • opencv_contrib (http://github.com/itseez/opencv_contrib) repository has been added. A lot of new functionality is there already! opencv_contrib is only compatible with 3.0/master, not 2.4. Clone the repository and use “cmake … -D OPENCV_EXTRA_MODULES_PATH=<path_to opencv_contrib/modules> …” to build opencv and opencv_contrib together.
  • a subset of Intel IPP (IPPCV) is given to us and our users free of charge, free of licensing fees, for commercial and non-commerical use. It’s used by default in x86 and x64 builds on Windows, Linux and Mac.
  • T-API (transparent API) has been introduced, this is transparent GPU acceleration layer using OpenCL. It does not add any compile-time or runtime dependency of OpenCL. When OpenCL is available, it’s detected and used, but it can be disabled at compile time or at runtime. It covers ~100 OpenCV functions. This work has been done by contract and with generous support from AMD and Intel companies.
  • ~40 OpenCV functions have been accelerated using NEON intrinsics and because these are mostly basic functions, some higher-level functions got accelerated as well.
  • There is also new OpenCV HAL layer that will simplifies creation of NEON-optimized code and that should form a base for the open-source and proprietary OpenCV accelerators.
  • The documentation is now in Doxygen: http://docs.opencv.org/master/
  • We cleaned up API of many high-level algorithms from features2d, calib3d, objdetect etc. They now follow the uniform “abstract interface – hidden implementation” pattern and make extensive use of smart pointers (Ptr<>).
  • Greatly improved and extended Python & Java bindings (also, see below on the Python bindings), newly introduced Matlab bindings (still in alpha stage).
  • Improved Android support – now OpenCV Manager is in Java and supports both 2.4 and 3.0.
  • Greatly improved WinRT support, including video capturing and multi-threading capabilities. Thanks for Microsoft team for this!
  • Big thanks to Google who funded several successive GSoC programs and let OpenCV in. The results of many successful GSoC 2013 and 2014 projects have been integrated in opencv 3.0 and opencv_contrib (earlier results are also available in OpenCV 2.4.x). We can name:
    • 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.
  • Besides Google, we enjoyed (and hope that you will enjoy too) many useful contributions from community, like:
    • biologically inspired vision module
    • DAISY features, LATCH descriptor, improved BRIEF
    • image registration module
      etc.
 

« メールス?マース?マーズ?MERSの正しい発音は? | トップページ | OpenCV3を64bitのPython3.4で使う。 »

Python」カテゴリの記事

HackerNewsうぉっち」カテゴリの記事

コメント

コメントを書く

(ウェブ上には掲載しません)

トラックバック


この記事へのトラックバック一覧です: OpenCV3.0が正式リリース!ついにPython3をサポート。:

« メールス?マース?マーズ?MERSの正しい発音は? | トップページ | OpenCV3を64bitのPython3.4で使う。 »

しろののツイッタータイムライン

  • ツイッターは5つ目も凍結されました。6つ目での復活も不可能。なのでnoteに注力しています。

    と思ったら、イーロン・マスクの買収が公になってアカウントが復活できました。ありがとうマスク。

    トランプ関連記事の一覧リスト

オススメたち

2024年12月
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

はてブ

無料ブログはココログ