Skip to content

Python版OpenCVのimg_hashモジュールを用いた画像ハッシュのサンプル

License

Notifications You must be signed in to change notification settings

Kazuhito00/OpenCV-img_hash-Sample

Repository files navigation

OpenCV-img_hash-Sample

Python版OpenCVのimg_hashモジュールを用いた画像ハッシュのサンプルです。

Requirement

  • opencv-contrib-python 4.5.2.54 or later

Algorithm

2021/07/02時点でOpenCVには以下6アルゴリズムが実装されています。

  • Average Hash
  • Block Mean Hash
  • Color Moment Hash
  • Marr Hildreth Hash
  • Perceptual Hash
  • Radial Variance Hashalgorithm

各アルゴリズムのパフォーマンスチャートは以下です。

※OpenCVドキュメント Performance under different attacksより引用

Usage

「OpenCV_img_hash_Sample.ipynb」をColaboratoryかJupyter notebook上で開いて実行してください。
また、画像をハッシュリスト化しpickle保存・読み込み、画像同士の類似度を比較するサンプルも用意しています。
以下のコマンドで実行できます。

python 01_compute_sample.py
python 02_compare_sample.py

Reference

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

OpenCV-img_hash-Sample is under Apache-2.0 License.

License(Image)

使用している画像はNHKクリエイティブ・ライブラリーストリートバスケットをフレーム毎に静止画を取り出したものです。

About

Python版OpenCVのimg_hashモジュールを用いた画像ハッシュのサンプル

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published