はじめに
jupyter notebookの対話的にパラメータを調整できる機能(ipywidgets IntSlider)で、skimage feature corner_harrisのパラメータを調整して、画像のコーナーを検出する方法について説明する。
コード

解説
モジュールのインポート
画像データの読み込み
画像は下記サイトから取得した。

コーヒーに砂糖を入れるイラスト
いらすとやは季節のイベント・動物・子供などのかわいいイラストが沢山見つかるフリー素材サイトです。
画像の表示
c_points, で空のplotを作成して、ここにコーナーの座標データを入れて表示することになる。
ipywidgetsの設定
coordsを任意のmin_distanceにおけるコーナー点の座標とし、c_points.set_xdata(), c_points.set_ydata()によって、プロットにコーナー点データをセットしている。
min_distanceを変化させたときのコーナー点の変化



参考
Jupyter Widgets — Jupyter Widgets 8.1.5 documentation
コメント