カニーエッジ検出
カニーエッジ検出には次のような特徴があります:
- 優れた検出精度:すべてのエッジを検出できる
- 位置の特定が正確:画像中の「実際の」エッジにできるだけ近いエッジが検出される
- レスポンスが最小限:位置ごとに許容されているエッジレスポンスは1つのみで、閉じた/交差するエッジに対する複数のレスポンスを回避できる
ソース画像とカニーエッジ検出後の結果
カニーエッジ検出の例
カニーエッジ検出に必要なパラメータは2つのみです:
- 関心がある特徴の特性スケール:ソース画像の平滑化に使用されるガウシアンフィルタの標準偏差。
- ヒステリシスを持つ勾配閾値:ソース画像の最大勾配の大きさで、0~1までの比率として表現されます(2つの値)。
カニーエッジ検出のAPIは単一クラス () で、次のメソッドがあります:
- Apply : applies the Canny edge detector on an image/ROI.
- GetHighThreshold : returns the high hysteresis threshold to consider that a pixel is an edge.
- GetLowThreshold : returns the low hysteresis threshold to consider that a pixel is an edge.
- GetSmoothingScale : returns the scale of the features of interest.
- GetThresholdingMode : returns the mode of the hysteresis thresholding.
- ResetSmoothingScale : prevents the smoothing of the source image by a Gaussian filter.
- SetHighThreshold : sets the high hysteresis threshold to consider that a pixel is an edge.
- SetLowThreshold : sets the low hysteresis threshold to consider that a pixel is an edge.
- SetSmoothingScale : sets the scale of the features of interest.
- SetThresholdingMode : sets the mode of the hysteresis thresholding.
結果画像は入力画像と同じ寸法でなければなりません。