edge detection & image sharpening -...

30
Edge Detection & Image Sharpening 김성영교수 금오공과대학교 컴퓨터공학과

Upload: others

Post on 06-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

Edge Detection & Image Sharpening

김성영교수

금오공과대학교

컴퓨터공학과

Page 2: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

2

학습 내용

Edge정의

Edge detection 개요및방법

Image sharpening 방법

Page 3: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

3

Edge 정의

A large change in image brightness over a short spatial distance

Page 4: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 5: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

555

Page 6: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

6

Edge detection 방법

darkbright

change of brightness

1st-order derivative

positivepeak

negativepeak

2nd-order derivative

Prewitt, Sobel, Roberts 등

Laplacian

Page 7: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 8: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 9: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 10: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 11: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

111111

(a) 원영상 (b) Prewitt

(c) Sobel (d) Roberts

Page 12: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

∂= + − + −

Page 13: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 14: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

141414

First vs. Second-order derivative

Page 15: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 16: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

161616

Laplacian of Gaussian filtering

[ ] ),(),(),( 2 yxfyxhyxg ∗∇=

( )2

22

24

2222 ),( σ

σσ

yx

eyxyxh+

−+−=∇

Page 17: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 18: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

181818

(a) 원영상(b) 4 방향라플라시안

(c) 8 방향라플라시안

(d) 가우시안의라플라시안

Page 19: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 20: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

202020

High-pass filtering

),(),(),( yxfyxfyxf LH −=

1 1 11 1 8 19

1 1 1

− − − × − − − − −

=

111111111

91

000010000

Page 21: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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로나누는것을제외하고계산

※경계외부는경계값으로채움

Page 22: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 23: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

232323

결과영상(α=9) Histogram equalization

Page 24: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

242424

−−−

010151

010

−−−

121252

121

Original image Contrast-enhanced

Laplacian-type filtering

−−−

010151

010

000010000

−−−

010141

010+=

Page 25: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

252525

InputImage

LowpassFilter

HistogramShrink

SubtractImages

HistogramStretch

ResultImage

+

Unsharp masking

Page 26: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

262626

),(),()1()},(),({),(

),(),(),(

crLcrIcrLcrIcrI

crHcrIcrE

λλλλ

−+=−+=

+=

),( crI

),( crL

),(),( crLcrI −

)},(),({),(),( crLcrIcrIcrE −+= λ

Page 27: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

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

Page 28: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

28

요약

Edge 짧은공간적인거리상에서영상의밝기혹은색상이급격하게변하는지점

Edge detection 개요 주로차분연산을이산적으로근사화하여사용 (마스크사용처리)

Edge의세기와방향을제공

Edge detection 방법 1차미분: Prewitt, Sobel, Roberts 등

2차미분: Laplacian (Laplacian of Gaussian)

Page 29: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

29

Image Sharpening 영상의상세정보를강화

High-pass filtering, High boost filtering, Laplacian-type filtering, Unsharp masking

Page 30: Edge Detection & Image Sharpening - KOCWcontents.kocw.net/KOCW/document/2012/kumoh/kimseongyeong/... · 2016-09-09 · 2. 학습내용. . Edge 정의. . Edge detection 개요및방법

30

Reference

R. Gonzalez, R. Woods, Digital Image Processing (2nd Edition), Prentice Hall, 2002

Scott E Umbaugh, Computer Imaging, CRC Press, 2005