LoginSignup
11
3

More than 1 year has passed since last update.

OpenCV 4.5.5 リリース!

Last updated at Posted at 2021-12-24

この記事はOpenCV Advent Calendar 2021の25日目の記事です。
他の記事は目次にまとめられています。

■ はじめに(もちべーしょん)

「できらぁ!」 ということで、それでは、元気に行ってみましょー!!

ただし、ロードマップ的には更に、OpenCV 4.6な話が...?

内容がかなり長いので、右の目次機能を使って、興味のあるところをちょこちょこ読むのがおすすめです。

この記事を公開準備している、2021/12/25 6:17現代はまだリリースされていません・・・ (追記)無事に、 2021/12/25 21:00ちょっとすぎたくらいにリリースされました。

https://github.com/opencv/opencv/wiki/ChangeLog
こちらの、Coming soon... 4.5.5 / 3.4.17 のところの内容を解釈して記載しています。

◯個人的に非常に興味深い

今回の修正ではこのあたりが非常によさそうな感じに見えますね!!

  • MSMF/GStreamerの音声対応!
    • Computer Visionとは……まあ、できることの幅が広がる事は、とてもいい事ですよね!
  • OpenCV.jsのハードアクセラレーション対応!!!(WebNN対応)
    • JavaScriptだから遅い、という常識が過去のものになる!!★★★
    • もうちょっと流行ると面白いけどなあ…・・・
  • QREncoder
    • たった3行で文字列⇒画像変換までやってくれるってすてき…

■ Audio support as part of VideoCapture API:MSMF #19721 + GStreamer #21264

  • Microsoft Media Foundation (MSMF) と、 GStreamerで、音声データを扱うことができるようになりました!
  • 動画から音声データを抜き出したり、付与したりできるようになった。
    • 音声部分からDeep Learningで情報を抜き出したり…
    • 映像部分から抽出した情報に基づいて音声部分にデータを書き込んだり。
    • AudioIO: add OpenCV audio reading to dnn speech recognition sample #21197 とか、素敵じゃないですかね!!

■ Updated SOVERSION handling rules: #21178

  • OpenCV 4.5.3 と 4.5.4 でもABI互換が取れなかった。
  • それなのに、shared libraryの名前が同じなのは…という問題提起がされた。
  • そこで、後方互換が無いということで、バージョニング方法の変更を導入する事になった。
  • ・・・あれ?もしかしてこれ使えば、複数バージョン共存とかできるんじゃ…(邪まスマイル)

■ DNN module patches:

DNN関係の修正が盛りだくさんですね...

□ Added tests to cover ONNX conformance test suite: #21088

  • ONNXの適合性テストの追加(らしい)

□ Improved layers / activations / supported more models

  • 36個のlayerが追加されました。
    • AcoshLayer,AcosLayer,ArgLayer,AsinhLayer,AsinLayer,AtanhLayer,AtanLayer,
    • CeilLayer,CeluLayer,CompareLayer,ConcatLayer,ConstLayer,ConvolutionLayer,ConvolutionLayerInt8,CorrelationLayer,CoshLayer,CosLayer,CropAndResizeLayer,
    • ErfLayer,ExpLayer, FloorLayer,FlowWarpLayer,HardSigmoidLayer, HardSwishLayer, LogLayer, NotLayer, RoundLayer,
    • SeluLayer,SinhLayer,SinLayer,SoftplusLayer,SoftsignLayer,SqrtLayer,SwishLayer,
    • TanLayer,ThresholdedReluLayer,

□ Upgraded builtin protobuf from 3.5.2 to 3.19.1

  • 3rdparty(protobuf): upgrade 3.5.2 => 3.19.1 #20998
    • シリアライズのためのライブラリprotobufのバージョンが、3.5.2から3.19.1まで上がりました。
    • protobuf自体の差分は、こちら参照。

□ More optimizations for RISC-V platform

  • Further optimize DNN for RISC-V Vector. #21086
    • vsetvlを利用して、分岐の代わりにvector tailでハンドリング。
    • 変数名をvlに統一。
    • 関数fastConvが行列のテールを処理する方法を修正。
  • Update RVV backend for using Clang. #21012
    • Clangでの対応もかな?

□ Intel® Inference Engine backend ( OpenVINO™ ):

  • added support for OpenVINO 2021.4.2 LTS release
    • OpenVinoの更新自体はこちら
    • 12世代Intel CPUサポートとかかな?

■ G-API module:

G-API関係は、チューニングの話が多い。ちょっとさっくり書いていく。

□ G-API framework:

  • Fixed issue with accessing 1D data from cv::RMat: #21103;
    • sourceのRMat::viewがdim==1の場合、cv::Matのdimがデフォルト2なのでおかしくなる問題の「暫定」対応。
  • Restricted passing the G-API types to graph inputs/outputs for execution: #21041;
    • 不正なパイプラインの受け渡しになるところを、コンパイル時警告。
  • Various fixes in G-API Doxygen reference: #20924;
    • 軽微なドキュメント修正
  • Renamed various internal structures for consistency #20836 #21040;
    • Rename RMat::Adapter to RMat::IAdapter #20836
    • GAPI: Rename MatAdapter to RMatOnMat #21040

□ Fluid backend:

Universal Intrinsicを利用して、各種Kernelのvectorize処理を進めた。

  • Introduced a better vectorized version of Resize: #20664.
  • Added vectorized version of Multiply kernel: #21024;
  • Added vectorized version of Divide kernel: #20914;
  • Added vectorized version of AddC kernel: #21119;
  • Added vectorized version of SubC kernel: #21158;
  • Added vectorized version of MulC kernel: #21177;
  • Added vectorized version of SubRC kernel: #21231;
  • Enabled SIMD dispatching for AbsDiffC: #21204;

□ OpenCL backend:

  • Fixed sporadic test failures in Multiply kernel running on GPU: #21205;
    • GPUを使って乗算カーネルがテストでこけていたのを直した。
    • テストでの比較が厳密すぎていた・・・ように見える。

□ Intel® OpenVINO™ inference backend:

  • Extended ie::Params to support static batch size as input to inference: #20856;
    • batch sizeへのアクセスができるようになっている。
  • Enabled 2D input tensor support in IE backend: #20925;
    • OpenVINOの nGraphAPIを扱うようになった・・・のかな?
  • Fixed various issues with imported (pre-compiled) networks: #20918;
    • commitが24個もあって、確かに「様々な問題の修正」すぎてコメントできない...

□ Media integration:

G-APIのパイプラインに、GStreamerとopenVPLが接続できるようになった、ように見える。

  • Introduced a GStreamer-based pipeline source for G-API: #20709;
    • G-APIにGStreamerのpipelineが接続!
  • Completed the integration of Intel® oneVPL as a pipeline source for G-API #20773 with device selection #20738, asynchronous execution #20901, intial demux support #21022, and GPU-side memory allocation via DirectX 11 #21049.
    • oneVPLをG-APIのpipeline sourceとして実装。
    • G-API: oneVPL (simplification) unite components in entire VPL source #20773
    • G-API: oneVPL - Implement IDeviceSelector & default cfg_param-based selector #20738
    • G-API: oneVPL - Performance: Add async decode pipeline & add cached pool #20901
    • G-API: oneVPL Implement asynchronous MFP demux data provider #21022
    • G-API: oneVPL merge DX11 acceleration #21049

□ Samples:

  • Replaced custom kernels with now-standard G-API operations in several samples #21106;
    • 標準的ではないG-API operationを用いるいくつかのサンプルに対して、置き換え
  • Moved API snippets from G-API samples to a dedicated place #20857;
    • サンプルコードの場所の移動

□ Other changes and fixes:

コンパイラ警告などを対応と。

  • Fixed various static analysis issues for OpenVINO 2021.4 release: #21083 and #21212;
    • [G-API] Fixed Coverity issues #21083
      • メンバ変数の初期化など、色々直している感じですね…
      • CV_ALWAYS_INLINEが導入されました。
    • [G-API] Bring updates from openvino version of standalone files #21212
      • 'CV_USRTYPE1'はもうなくなったよ! CV_16Fでやってね!
  • Fixed various build warnings introduced after OpenVINO update: #20937;
    • G-API: Disable Windows warnings with 4996 code #20937
      • コンパイルオプションの変更。 -
  • Continued clean-up in the G-API test suite on GTest macros #20922 and test data #20995;
    • GAPI: Align EXPECT/ASSERT macros #20922
      • ‘ASSER_EQ()` 何かを使うときの順番を直している。
    • G-API: Removing G-API test code that is a reflection of ts module #20995
      • 不要な関数呼び出しの削除
  • Added custom accuracy comparison functions to Fluid performance tests: #21150.
    • パフォーマンステストで、customな信頼性関数の追加、かな?

■ And many other contributions:

□ Added QRcode encoder: #17889

□ GSoC - OpenCV.js: Accelerate OpenCV.js DNN via WebNN: #20406

  • OpenCV.jsのDNN実装を、WebNNで置き換える事で性能向上を図る。
    • WebNN はこちらに情報がある。
      • ニューラルネットワーク推論ハードウェアアクセラレーション専用の、Low Level API !!
      • つまり、OpenCV.jsが、ハードゴリゴリできる!やった!!楽しい!!
    • https://github.com/opencv/opencv/pull/20406 のベンチマーク結果が興味深い。
      • Nativeと戦えるレベル。
  • OpenCV.jsでのDNN活用が、ますます捗りますね!!!★

□ Add conventional Bayer naming: #20970

□ (opencv_contrib) Add Radon transform function to ximgproc: #3090

  • Radon transform(ラドン変換)は…… うーん調べるだけでかなりの時間がかかりそう。CTスキャンなんかで読み取った画像から元の状態を復元するのとかに使われていそうな感じ。

□ (opencv_contrib) New superpixel algorithm (F-DBSCAN): #3093

  • superpixelは、色・テクスチャが類似するピクセルをひとまとめにしたもの。
  • OpenCVのスーパーピクセル で紹介されているものに新規アルゴリズムが追加された。
  • DBSCANについては、WikipediaのDBSCANのページがまとまっている。

□ Created Stitching Tool: #21020

  • stitchingは、画像連結。Pyhtonベースでのテストアプリが追加。

□ Improve CCL with new algorithms and tests: #21275

  • CCLは、連結要素の抽出ですね。 connectedComponents()で使える、2値画像へのラベリングをする機能。

  • 4.5.4以前

    • CCL_BOLELLI(=CCL_SPAGHETTI)で指定された場合、8wayではSpaghetti algorithm, 4wayではSAUF algorithm。
      • Spaghetti [26] algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity.
  • 4.5.5以降

    • CCL_BOLELLI(=CCL_SPAGHETTI)で指定された場合、新たに4wayもSpaghetti algorithm実装
      • 並列計算にも対応。
      • Spaghetti [26] algorithm for 8-way connectivity, Spaghetti4C [27] algorithm for 4-way connectivity. The parallel implementation described in [25] is available for both Spaghetti and Spaghetti4C.

□ (opencv_contrib) Update ArUco tutorial: #3126

- ArUco tutorial:の更新

■ そのほか(私が気になったところ)

  • realsense関係
    • New example for realsense#21279
    • Illustration about realsense #21253
  • モジュール構成の変更(valgrindのエラーからかな?)
    • Split cv2.cpp #21182
    • Task: split cv2.cpp compilation #21175
  • 1pixelの色変換ができない問題の解決
    • cv2.cvtColor does not work with single pixel in OpenCV 4.5.4-dev #20968

■ まとめ

  • OpenCVは、静止画・動画だけでなく、更に音声まで解析対象を広げることができるようになりました。
  • また、OpenCV.jsは、ハードアクセラレーションも活用できるようになり、更に応用範囲を広げそうです。
  • 今後も、ONNX対応など、機械学習方向でますますOpenCVは発展をしていきそうですね!
  • 更なる発展を期待しつつ、こちらでOpenCV 4.5.5の紹介を終了とさせていただきたいと思います。

それでは、良いお年をお迎えください!!

※ただし、私は、来週も元気にお仕事です

■ おまけ

今回は、リリースノートの先行版がアップロードされていたおかげで、なんとか時間内に対応できました。

最初はDNN部分がTBDになっていて、まだかなまだかなと思っていたら、いきなりどーんと大ボリュームの更新があってびっくりしました。

それでは、2022年も楽しくcomputer visionで遊んでまいりましょう!

11
3
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
11
3