はじめに
skimage.filters の roberts, sobelを用いた画像のエッジ検出について解説する。
コード

解説
この例では、画像内のエッジの部分を検出するfilters の roberts, sobelの使い方について説明する。
モジュールのインポート
バージョン
画像の読み込み

上の画像を読みこんで表示すると下のようになる。

画像のグレースケール化
skimage.color の rgb2grayでグレースケール化すると下のようになる。

フィルタの適用
各フィルタに用いられるカーネルは、下記のようになっている。
roberts


sobel


図の表示
コードをダウンロード(.pyファイル)
コードをダウンロード(.ipynbファイル)
参考
Edge operators — skimage 0.25.1 documentation
skimage.filters — skimage 0.25.2rc0.dev0 documentation
skimage.filters — skimage 0.25.2rc1.dev0 documentation
コメント
[…] [scikit-image] 16. エッジ演算子(filters.roberts, sobel)skimage.filters の roberts, sobelを用いた画像のエッジ検出sabopy.com2019.05.10 [scikit-image] 53. 画像のラベリング(skimage.measure labelなど)skimage.filtersのthresho […]