Transcript 1次微分(一階導數)
Chapter 3 空間領域中的影像処理 Image Segmentation 影像二値化例子 影像特徴抽出濾波器( filter) ・1次微分(一階導數) filter (edge detection, line detection) ・2次微分(二階導數) filter (Laplacian filter) ・影像強化 (低頻強化、高頻強化) 影像鋭利化 (original image – Laplacian image ------------------------------------------------------------------------------------------------------------------------------------- 空間頻域 filtering 影像微分 (一階導數) 微分→差分 x方向微分 及 y方向微分: f [i 1, j ] f [i, j ] f [i 1, j ] f [i, j ] i 1 i f [i, j 1] f [i, j ] y f f [i, j 1] f [i, j ] j 1 j xf 給予対称性 梯度(gradient) 方向(orientation) x f f [i 1, j ] f [i 1, j ] y f f [i, j 1] f [i, j 1] g[i, j ] ( x f ) 2 ( y f ) 2 [i, j ] tan ( 1 y f x f ) 利用1次微分(一階導數)来偵測影像邊縁 Digital Image的1次微分:用差分法来代替 実際的1維影像f(x)的微分結果→g(x): g(x) = f(x+1) – f(x-1) 理解方便上:g(x) = f(x+1) – f(x) Sobel filters (Sobel 濾波器 ) Sobel濾波器使用空間一階導數來增強高頻的空間訊號。 在影像中,這些高頻訊號通常代表較鋭利的物體邊縁或 線條特徴。 一維的一階導數 f f ( x 1) f ( x) x f f 二維的一階導 f Gx G y 數以梯度 xy x y (gradient)表示 梯度的大小 (amplitude)是 G G x Gy 2 2 方向(orientation)則為 arctan(Gy / Gx ) Gx Gy Sobel Filter的edge 検出(偵測)例 a b c d (a) Original (b) 水平方向的edge成分 (c) 垂直方向的edge成分 (d) 水平與垂直成分合成之 edge image Image Segmentation (a) Original (b) Gx (c) G y (d) Gx G y a b c d 利用1次微分(差分)偵測影像邊縁之例 Original image Sobel Prewitt 利用1次微分(差分)偵測影像邊縁之例 Original Processed by Sobel filter Processed by Prewitt filter Resultant images using Sobel filter 二階導數濾波器:Laplacian filter濾波器 拉普拉斯濾波器是一種空間二階導數的運算子, 它對於影像中快速變化的區域(包含edge)具有 很大的強化作用,因此常結合Zero Crossing Detection(如下圖)作為邊縁偵測的工具。 Image Segmentation 一階導數 二階導數 0 1 0 1 -4 1 0 1 0 (Lapalacian演算子) 原始影像的 低頻成分與高頻成分 低頻成分 高頻成分 空間頻域的高頻増強 空間頻域的低頻増強 影像鋭利化: (Original Image)-(Laplacian濾波後影像) 0 0 1 1 -4 0 1 0 1 0 -1 0 -1 5 -1 0 -1 0 Example Original Smoothing 平均値filter Highfrequency component Un-sharp masking Image Segmentation Laplacian of Gaussian filter Gaussian平滑濾波+Laplacian濾波 利用Laplacian filter 做影像増強 (鋭利化) -1 -1 -1 -1 9 -1 -1 -1 -1 Edge Detection邊縁偵測 2次微分(二階導數)的場合(Laplacian filter) 原始影像 Laplacian Original - Laplacian Image Enhancement in the Spatial Domain a b a. Original image (moon) b. Laplacian-filtered image c d c. Laplacian image scaled for display purpose d. a+b (enhanced image) Image Enhancement in the Spatial Domain a b a. Image of whole body bone scan. b. Laplacian of (a). c d c. Sharpened image obtained by adding (a) and (b). d. Sobel of (a). Q&A