Top Banner
Lecture 6 Sharpening Filters 1. The concept of sharpening filter 2. First and second order derivatives 3. Laplace filter 4. Unsharp mask 5. High boost filter 6. Gradient mask 7. Sharpening image with MatLab
33

Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

Dec 14, 2015

Download

Documents

Shea Sidwell
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

Lecture 6 Sharpening Filters

1. The concept of sharpening filter

2. First and second order derivatives

3. Laplace filter

4. Unsharp mask

5. High boost filter

6. Gradient mask

7. Sharpening image with MatLab

Page 2: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

2

Sharpening Spatial Filters

• To highlight fine detail in an image or to enhance detail that has been blurred, either in error or as a natural effect of a particular method of image acquisition.

• Blurring vs. Sharpening

• Blurring/smooth is done in spatial domain by pixel averaging in a neighbors, it is a process of integration

• Sharpening is an inverse process, to find the difference by the neighborhood, done by spatial differentiation.spatial differentiation.

Page 3: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

3

Derivative operator

• The strength of the response of a derivative operator is proportional to the degree of discontinuity of the image at the point at which the operator is applied.

• Image differentiation – enhances edges and other discontinuities (noise)– deemphasizes area with slowly varying gray-level

values.

Page 4: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

4

Sharpening edge by First and second order derivatives

• Intensity function f =

• First derivative f ’ =

• Second-order derivative

f ’’ =

• f- f ’’ =

f

f’

f’’f-f’’

Page 5: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

5

First and second order difference of 1D

• The basic definition of the first-order derivative of a one-dimensional function f(x) is the difference

• The second-order derivative of a one-dimensional function f(x) is the difference

)()1( xfxfx

f

)(2)1()1(2

2

xfxfxfx

f

Page 6: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.
Page 7: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

7

First and Second-order derivative of 2D

• when we consider an image function of two variables, f(x, y), at which time we will dealing with partial derivatives along the two spatial axes.

y

yxf

x

yxf

yx

yxf

),(),(),(

f

2

2

2

22 ),(),(

y

yxf

x

yxff

(linear operator)

Laplacian operator(non-linear)

Gradient operator

Page 8: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

8

Discrete form of Laplacian

),(2),1(),1(2

2

yxfyxfyxfx

f

),(2)1,()1,(2

2

yxfyxfyxfy

f

from

)],(4)1,()1,(

),1(),1([2

yxfyxfyxf

yxfyxff

Page 9: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

9

Result Laplacian mask

Page 10: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

10

Laplacian mask implemented an extension of diagonal neighbors

Page 11: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

11

Other implementation of Laplacian masks

give the same result, but we have to keep in mind that when combining (add / subtract) a Laplacian-filtered image with another image.

Page 12: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

12

Effect of Laplacian Operator• as it is a derivative operator,

– it highlights gray-level discontinuities in an image– it deemphasizes regions with slowly varying gray levels

• tends to produce images that have – grayish edge lines and other discontinuities, all superimposed on

a dark, – featureless background.

Page 13: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

13

Correct the effect of featureless background

• easily by adding the original and Laplacian image.• be careful with the Laplacian filter used

),(),(

),(),(),(

2

2

yxfyxf

yxfyxfyxg

if the center coefficient of the Laplacian mask is negative

if the center coefficient of the Laplacian mask is positive

Page 14: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

14

Example

• a). image of the North pole of the moon

• b). Laplacian-filtered image with

• c). Laplacian image scaled for display purposes

• d). image enhanced by addition with original image

1 1 1

1 -8 1

1 1 1

Page 15: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

15

Mask of Laplacian + addition

• to simply the computation, we can create a mask which do both operations, Laplacian Filter and Addition the original image.

Page 16: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

16

Mask of Laplacian + addition

)]1,()1,(

),1(),1([),(5

)],(4)1,()1,(

),1(),1([),(),(

yxfyxf

yxfyxfyxf

yxfyxfyxf

yxfyxfyxfyxg

0 -1 0

-1 5 -1

0 -1 0

Page 17: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

17

Example

Page 18: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

18

Note

0-1

0

-1

5-1

0-1

0

0 0 0

0 1 0

0 0 0

),(),(

),(),(),(

2

2

yxfyxf

yxfyxfyxg

= +0

-1

0

-1

4-1

0-1

0

0-1

0

-1

9-1

0-1

0

0 0 0

0 1 0

0 0 0= +

0-1

0

-1

8-1

0-1

0

Page 19: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

19

Unsharp masking

• to subtract a blurred version of an image produces sharpening output image.

),(),(),( yxfyxfyxf s

sharpened image = original image – blurred imagesharpened image = original image – blurred image

Page 20: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

Unsharp mask

Page 21: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.
Page 22: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

22

High-boost filtering

• generalized form of Unsharp masking• A 1

),(),(),( yxfyxAfyxfhb

),(),()1(

),(),(),()1(),(

yxfyxfA

yxfyxfyxfAyxf

s

hb

Page 23: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

23

High-boost filtering

• if we use Laplacian filter to create sharpen image fs(x,y) with addition of original image

),(),()1(),( yxfyxfAyxf shb

),(),(

),(),(),(

2

2

yxfyxf

yxfyxfyxf s

),(),(

),(),(),(

2

2

yxfyxAf

yxfyxAfyxfhb

Page 24: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

24

High-boost Masks

A 1 if A = 1, it becomes “standard” Laplacian sharpening

Page 25: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

25

Example

Page 26: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

26

Gradient Operator

• first derivatives are implemented using the magnitude of the gradientmagnitude of the gradient.

y

fx

f

G

G

y

xf

21

22

2122 ][)f(

y

f

x

f

GGmagf yx

the magnitude becomes nonlinearyx GGf

commonly approx.

Page 27: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

27

Gradient Mask

• simplest approximation, 2x2z1 z2 z3

z4 z5 z6

z7 z8 z9

)( and )( 5658 zzGzzG yx

212

562

582

122 ])()[(][ zzzzGGf yx

5658 zzzzf

Page 28: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

28

Gradient Mask

• Roberts cross-gradient operators, 2x2

z1 z2 z3

z4 z5 z6

z7 z8 z9

)( and )( 6859 zzGzzG yx

212

682

592

122 ])()[(][ zzzzGGf yx

6859 zzzzf

Page 29: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

29

Gradient Mask

• Sobel operators, 3x3

z1 z2 z3

z4 z5 z6

z7 z8 z9

)2()2(

)2()2(

741963

321987

zzzzzzG

zzzzzzG

y

x

yx GGf

the weight value 2 is to achieve smoothing by giving more important to the center point

Page 30: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

30

Example

Page 31: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

31

Example of Combining Spatial Enhancement Methods

• want to sharpen the original image and bring out more skeletal detail.

• problems: narrow dynamic range of gray level and high noise content makes the image difficult to enhance

Page 32: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.

32

Example of Combining Spatial Enhancement Methods

• solve :

1. Laplacian to highlight fine detail2. gradient to enhance prominent edges3. gray-level transformation to increase the dynamic

range of gray levels

Page 33: Lecture 6 Sharpening Filters 1.The concept of sharpening filter 2.First and second order derivatives 3.Laplace filter 4.Unsharp mask 5.High boost filter.