edge detection & image sharpening -...
TRANSCRIPT
Edge Detection & Image Sharpening
김성영교수
금오공과대학교
컴퓨터공학과
2
학습 내용
Edge정의
Edge detection 개요및방법
Image sharpening 방법
3
Edge 정의
A large change in image brightness over a short spatial distance
4
Edge detection 개요
Most are based on discrete approximations to differential operators
Implemented with convolution masks
Return orientation or existence of an edge information
Used as a first step in the line detection or object outlines process
555
6
Edge detection 방법
darkbright
change of brightness
1st-order derivative
positivepeak
negativepeak
2nd-order derivative
Prewitt, Sobel, Roberts 등
Laplacian
777
∂∂
∂∂
=
=∇
yf
xf
G
Gf
y
x [ 1, ] [ , ], [ , 1] [ , ]x yG f x y f x y G f x y f x y≅ + − ≅ + −
2 2 max( , )x y x y x yG G G G G G G= + ≈ + ≈
1 (x, y) tan y
x
GG
α − =
1st-order derivative
Gx
G y
edge
line
888
−−−
=1 0 11 0 11 0 1
),( yxhx
−−−=
1 1 1 0 0 0 111
),( yxhy
[ 1, ] [ , ], [ , 1] [ , ]x yG f x y f x y G f x y f x y≅ + − ≅ + −
( , ) ( , ), ( , ) ( , )x x y yG h x y f x y G h x y f x y= ∗ = ∗
Prewitt
[ ]101111
−⋅
Simple box filter
Finite diff filter
999
−−−
=1 0 12 0 21 0 1
),( yxhx
−−−=
1 2 1 0 0 0 121
),( yxhy
[ 1, ] [ , ], [ , 1] [ , ]x yG f x y f x y G f x y f x y≅ + − ≅ + −
( , ) ( , ), ( , ) ( , )x x y yG h x y f x y G h x y f x y= ∗ = ∗
Sobel
[ ]101121
−⋅
Simple Gaussian filter
Finite diff filter
101010
Roberts
−=
0 0 10 1 0 0 0 0
),( yxhx
−=
0 0 0 0 1 0 0 0 1
),( yxhy
[ 1, ] [ , ], [ , 1] [ , ]x yG f x y f x y G f x y f x y≅ + − ≅ + −
( , ) ( , ), ( , ) ( , )x x y yG h x y f x y G h x y f x y= ∗ = ∗
No the orientation information
111111
(a) 원영상 (b) Prewitt
(c) Sobel (d) Roberts
121212
Laplacian
2
2
2
22
yf
xff
∂∂
+∂∂
=∇
2
2
( [ 1, ] [ , ]) [ 1, ] [ , ]xGf f x y f x y f x y f x yx x x x x
∂∂ ∂ + − ∂ + ∂= = = −
∂ ∂ ∂ ∂ ∂
( [ 1, ] [ , ]) ( [ , ] [ 1, ]) [ 1, ] 2 [ , ] [ 1, ]f x y f x y f x y f x y f x y f x y f x y= + − − − − = + − + −
[ ]2 ( , 1) ( 1, ) ( 1, ) ( , 1) 4 ( , )f f x y f x y f x y f x y f x y∇ = + + − + + + − −
2
2 [ , 1] 2 [ , ] [ , 1]f f x y f x y f x yy
∂= + − + −
∂
131313
0 1 01 4 10 1 0
−
0 1 01 4 10 1 0
− − − −
1 1 11 8 11 1 1
−
1 1 11 8 11 1 1
− − − − − − − −
common spatial convolution masks
141414
First vs. Second-order derivative
151515
• First-order derivatives generally produce thicker edges
• Second-order derivatives have a stronger response to fine detail, such as thin lines and isolated points
• First-order derivatives generally have a stronger response to a gray-level step
• Second-order derivatives produce a double response at step changes in gray level
In most applications, the second-order derivative is better suited than the first derivative for image enhancement
161616
Laplacian of Gaussian filtering
[ ] ),(),(),( 2 yxfyxhyxg ∗∇=
( )2
22
24
2222 ),( σ
σσ
yx
eyxyxh+
−
−+−=∇
171717
1.0
0.70 0 -1 0 00 -1 -2 -1 0-1 -2 16 -2 -10 -1 -2 -1 00 0 -1 0 0
LoG mask
181818
(a) 원영상(b) 4 방향라플라시안
(c) 8 방향라플라시안
(d) 가우시안의라플라시안
19
Image Sharpening
enhancing detail information in an imagetypically contained in the high spatial frequencycomponents of the image
done by various types of high boost filters and Laplacian-type filters
202020
High-pass filtering
),(),(),( yxfyxfyxf LH −=
1 1 11 1 8 19
1 1 1
− − − × − − − − −
=
−
111111111
91
000010000
212121
-10 -20 -10 -20 -10 0 0 0
-20 40 20 40 -20 0 0 0
-30 20 80 20 -30 0 0 0
-20 40 20 40 -20 0 0 0
-10 -20 -30 -20 -10 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
High-passfiltering
10 10 10 10 10 10 10 10
10 20 20 20 10 10 10 10
10 20 30 20 10 10 10 10
10 20 20 20 10 10 10 10
10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10
※이전슬라이드의마스크에서9로나누는것을제외하고계산
※경계외부는경계값으로채움
222222
High boost filtering
)1(19
11111111
1111191111
91
111111111
91
000010000
,111111111
91
≥−=∴
⇒
=
−
=
AA
--------
----A-----
A
fL
α
α
{ }{ }
),(),()1(),(),(
),()1(),(),(),(
yxfyxfAyxfyxf
yxfAyxfyxAfyxg
H
L
L
+−=−+
−=−=
High boost
232323
결과영상(α=9) Histogram equalization
242424
−−−
−
010151
010
−−−
−
121252
121
Original image Contrast-enhanced
Laplacian-type filtering
−−−
−
010151
010
000010000
−−−
−
010141
010+=
252525
InputImage
LowpassFilter
HistogramShrink
SubtractImages
HistogramStretch
ResultImage
+
−
Unsharp masking
262626
),(),()1()},(),({),(
),(),(),(
crLcrIcrLcrIcrI
crHcrIcrE
λλλλ
−+=−+=
+=
),( crI
),( crL
),(),( crLcrI −
)},(),({),(),( crLcrIcrIcrE −+= λ
272727
OriginalImage
Unsharpmaskinglower limit=0, upper=100,2% low andhigh clipping
Unsharpmaskinglower limit=0, upper=200,2% low andhigh clipping
Unsharpmasking
lower limit=0, upper=150,2% low and
high clipping
28
요약
Edge 짧은공간적인거리상에서영상의밝기혹은색상이급격하게변하는지점
Edge detection 개요 주로차분연산을이산적으로근사화하여사용 (마스크사용처리)
Edge의세기와방향을제공
Edge detection 방법 1차미분: Prewitt, Sobel, Roberts 등
2차미분: Laplacian (Laplacian of Gaussian)
29
Image Sharpening 영상의상세정보를강화
High-pass filtering, High boost filtering, Laplacian-type filtering, Unsharp masking
30
Reference
R. Gonzalez, R. Woods, Digital Image Processing (2nd Edition), Prentice Hall, 2002
Scott E Umbaugh, Computer Imaging, CRC Press, 2005