バックナンバーはこちら。
https://www.simulationroom999.com/blog/compare-matlabpythonscilabjulia3-backnumber/
はじめに
Hysteresis Thresholdを実施するための手順を確認する。
登場人物
博識フクロウのフクさん

イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん

イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
Hysteresis Thresholdの雰囲気

で、実際にHysteresis Thresholdを試すことになるのだろうけど、
処理手順とかを確認しておいた方が良いのかな?

そうだね。
と言っても、非極大値抑制をするところの流れは一緒なんだけど。
念のため書き出しておこう。
- Sobelフィルタ等の微分フィルタで以下を推定
- x軸、y軸の濃淡変化量
- 変化強度(ノルム)
- 「x軸、y軸の濃淡変化量」から勾配方向角を推定
- arntan関数を利用
- 勾配方向を垂直(UD)、水平(LR)、斜め右上から右下(RULD)、斜め左上から右下の4パターンに丸め。
- 勾配方向角に応じて極大値評価をして非極大値だったら「変化強度(ノルム)」 を0値埋め
- Hysteresis Threshold
- High以上は白
- Low未満は黒
- High-Lowの間の場合は周辺を探査し、エッジが居れば白、いなければ黒
- 画像出力

確かに、非極大値抑制の時の処理に追加されただけだね。
Canny法

実は、Sobelフィルタ、非極大値抑制、Hysteresis Thresholdを組み合わせた手法には名称がついている。

名称?
どんな?

Canny法と言う。
Wikipediaからプロセスの部分を引用しよう。
The process of Canny edge detection algorithm can be broken down to five different steps:
Wikipediaより(https://en.wikipedia.org/wiki/Canny_edge_detector)
- Apply Gaussian filter to smooth the image in order to remove the noise
- Find the intensity gradients of the image
- Apply gradient magnitude thresholding or lower bound cut-off suppression to get rid of spurious response to edge detection
- Apply double threshold to determine potential edges
- Track edge by hysteresis: Finalize the detection of edges by suppressing all the other edges that are weak and not connected to strong edges.
↓日本語訳
Canny エッジ検出アルゴリズムのプロセスは、次の 5 つの異なるステップに分類できる。
Wikipediaより(https://en.wikipedia.org/wiki/Canny_edge_detector)
- ガウス フィルターを適用して画像を滑らかにし、ノイズを除去。
- 画像の強度勾配を見つける
- 勾配の大きさのしきい値処理または下限カットオフ抑制を適用して、エッジ検出に対するスプリアス応答を除去。
- 二重しきい値を適用して潜在的なエッジを決定
- ヒステリシスによるエッジの追跡: 弱いエッジや強いエッジに接続されていない他のすべてのエッジを抑制することで、エッジの検出を完了する。

細かいところは何言ってるか分からないけど、今回やろうとしていることと流れは一緒な気はする。

1番がガウシアンフィルタ、2番がSobelフィルタの勾配方向の特定、3番が非極大値抑制、4番と5番がHysteresis Thresholdという感じだろう。

なるほど。

というわけで、次回からHysteresis Thresholdの処理を加えたCanny法を実施していく。
まとめ

まとめだよ。
- Hysteresis Thresholdを実施するための手順を確認。
- 非極大値抑制にHysteresis Thresholdを加えただけ。
- 上記の手順はCanny法という名称がついている。
- Wikipediaに記載されているCanny法について確認。
バックナンバーはこちら。
コメント