350 likes | 577 Vues
画像特徴(点、直線、領域)の検出と識別- 2 呉海元@和歌山大学 2007 年5月 14 日. エッジの検出. 空間フィルタと画像畳み込み. kernel. image. 注意:すべての空間フィルタ内の係数の合計=1. Low-pass filter. 画像平滑化. High-Pass Filter. 画像鮮鋭化. エッジ検出1. 画像中に表示された物理の輪郭( エッジ: edge )や線では、一般的に濃淡が急激に変化 エッジや線の検出処理は、画像理解や認識のための前処理として重要 計算コストが低い 強い視覚の手がかりを提供できる 物体の輪郭 認識できる特徴
E N D
画像特徴(点、直線、領域)の検出と識別-2呉海元@和歌山大学2007年5月14日画像特徴(点、直線、領域)の検出と識別-2呉海元@和歌山大学2007年5月14日 エッジの検出
空間フィルタと画像畳み込み kernel image 注意:すべての空間フィルタ内の係数の合計=1
Low-pass filter 画像平滑化
High-Pass Filter 画像鮮鋭化
エッジ検出1 画像中に表示された物理の輪郭(エッジ:edge)や線では、一般的に濃淡が急激に変化 エッジや線の検出処理は、画像理解や認識のための前処理として重要 計算コストが低い 強い視覚の手がかりを提供できる 物体の輪郭 認識できる特徴 見え隠れ 照明あるいは表面色の不連続性
Roof edge Concave roof edge Ramp edge Step edge Bar edge Edge Types • Different edge models: 階段 屋根 凹形 傾斜 棒
勾配(エッジ)の方向: • 勾配(エッジ)の大きさ: 画像勾配の離散化 画像の勾配( Image gradient ) • 画像の勾配: • 各方向の勾配
有名なGradient operators (a): Roberts’ cross operator (b): 3x3 Prewitt operator (c): Sobel operator (d) 4x4 Prewitt operator
ノイズの影響( Effects of noise) • Consider a single row or column of the image • Plotting intensity as a function of position gives a signal 1D • Where is the edge? 微分するとノイズを強調される
Gaussian • Look for peaks in エッジ抽出前、まずフィルタhより平滑化 1D • Where is the edge?
畳み込みの定理より 1D
Laplacian of Gaussian 1D • Consider Laplacian of Gaussian operator • Where is the edge? • Zero-crossings of bottom graph
2D エッジ検出フィルタ • is the Laplacian operator: Laplacian of Gaussian Gaussian derivative of Gaussian ノイズを抑制しながらエッジを検出
エッジ検出2 様々なオペレータと異なるパラメータより2D空間フィルタを構成し、エッジを検出 注意:エッジ検出の場合 すべてのフィルタ内の係数の合計=0
最適なエッジ検出器Canny Edge Detector • 良いエッジ検出器とは • Good Detection: ノイズに強い • Good Localization: 真のエッジの所を検出 • Single Response:各点に一本のエッジを検出
Canny Edge Detector の処理手順 • Gaussianフィルタで画像を平滑化 • 平滑化された画像の微分を計算 • 勾配の大きさと方向を求める • “Non-maximum Suppression”処理を行う • “Hysteresis Threshold”処理を行う
Canny Edge Detector 1.Gaussianフィルタで画像を平滑化 2.平滑化された画像の微分を計算
Canny Edge Detectorステップ1と2処理後の結果例 入力画像
Canny Edge Detectorステップ3処理後の結果例 3.勾配の大きさと方向を求める 入力画像 勾配の大きさ
Canny Edge Detector 4.“Non-maximum Suppression”処理を行う • 勾配(エッジ)方向に沿って、画素はローカル最大か否かをチェック(非最大エッジ抑制)
Canny Edge Detector 4.“Non-maximum Suppression”処理を行う • 勾配(エッジ)方向に沿って、画素qはローカル最大か否かをチェック(非最大エッジ抑制)するとき • 内挿画素pとrをチェックすることになる
Canny Edge Detector勾配方向の量子化 内挿画素の問題を解決するため 2 3 1 0
次のエッジ点を予測 Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s). (Forsyth & Ponce)
Canny Edge DetectorNon-Maximum Suppressionの処理結果 2値化処理 Step 3 Step 4
‘edge pixel’ High Gradient magnitude low • “non-edge-pixel” Canny Edge Detector 5. “Hysteresis Threshold”処理を行う • Scan the image from left to right, top-bottom. • If the gradient at a pixel is • above “High”, declare it an ‘edge pixel’ • below “Low”, declare it a “non-edge-pixel” ヒステリシス閾処理
‘edge pixel’ High Gradient magnitude low • “non-edge-pixel” Canny Edge Detector 5. “Hysteresis Threshold”処理を行う • If the gradient at a pixel is • between “low” and “high” • Consider its neighbors iteratively then declare it an “edge pixel” if it is connectedto an ‘edge pixel’ directly or via pixels between “low” and “high”. ヒステリシス閾処理
Canny Edge Detector“Hysteresis Threshold”処理を行う • Connectedness x x x 8 connected 6 connected 4 connected
Effect of (Gaussian kernel size) original Canny with Canny with • The choice of depends on desired behavior • large detects large scale edges • small detects fine features
Canny Edge Detector gx(x,y) Gradient magnitude Image Non-maximum suppression Hysteresis thresholding gy(x,y) Gradient direction
Canny Edge Detectorの処理流れを述べてください。 OpenCVではサンプルプログラムがあります。 関連パラメータを調整しながら、好きな一枚の画像のエッジを検出してください。 レポートには元画像、使ったパラメータと処理後の画像をそれぞれ記述してください。 レポート 出席チェック3 提出期限: 3週間以内(講義の時 OR 私の部屋(A612))
Gaussian - image filter Gaussian delta function Laplacian of Gaussian