image preprocessing in spatial domain - cmpcmp.felk.cvut.cz/cmp/courses/e383zs/xe383zs... · image...

93
Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges Revision: 1.2, dated: May 25, 2007 Tom´ s Svoboda Czech Technical University, Faculty of Electrical Engineering Center for Machine Perception, Prague, Czech Republic [email protected] http://cmp.felk.cvut.cz/~svoboda

Upload: others

Post on 24-Sep-2020

42 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

Image preprocessing in spatial domainSharpening, image derivatives, Laplacian, edges

Revision: 1.2, dated: May 25, 2007

Tomas Svoboda

Czech Technical University, Faculty of Electrical Engineering

Center for Machine Perception, Prague, Czech Republic

[email protected]

http://cmp.felk.cvut.cz/~svoboda

Page 2: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

2/35Spatial Filtering — overview

We have learned

� smoothing

� remove noise

� pattern matching (normalised cross–correlation)

Page 3: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

2/35Spatial Filtering — overview

We have learned

� smoothing

� remove noise

� pattern matching (normalised cross–correlation)

We will learn today

� sharpening

� image derivatives

� edges

Page 4: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

3/35Sharpening

Enhancing differences. So, the kernels involve differences — combine

positive and negative weights.

� unsharp masking

� 1st and 2nd derivatives

Page 5: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

4/35Unsharp masking

� Often appears in Image manipulation packages (Gimp, ImageMagick)

� Quite powerful it cannot do miracles, though.

Idea: Subtract out the blur.

Procedure:

1. Blur the image

2. Subtract from original

3. Multiply by a weight

4. Combine (add to) with the original

Page 6: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

5/35Unsharp masking — Mathematically

g = f + α(f − fb)

� f original image

� fb blurred image

� g sharpened result

� α controls the sharpening

What is the unsharp mask?

.

Page 7: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

5/35Unsharp masking — Mathematically

g = f + α(f − fb)

� f original image

� fb blurred image

� g sharpened result

� α controls the sharpening

What is the unsharp mask?

g = 1 ∗ f + α(1 ∗ f −B ∗ f)

.

Page 8: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

5/35Unsharp masking — Mathematically

g = f + α(f − fb)

� f original image

� fb blurred image

� g sharpened result

� α controls the sharpening

What is the unsharp mask?

g = 1 ∗ f + α(1 ∗ f −B ∗ f)

= (1 + α(1−B)) ∗ f

.

Page 9: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

5/35Unsharp masking — Mathematically

g = f + α(f − fb)

� f original image

� fb blurred image

� g sharpened result

� α controls the sharpening

What is the unsharp mask?

g = 1 ∗ f + α(1 ∗ f −B ∗ f)

= (1 + α(1−B)) ∗ f= U ∗ f

where U is the desired unsharp mask.

Page 10: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

6/35Unsharp masking — Blur image

Page 11: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

7/35Unsharp masking — Subtract from original

− =

Page 12: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

8/35Unsharp masking — Adding to the original

+ =

Page 13: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

9/35Unsharp masking — Result

Page 14: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

10/35Unsharp masking — unsharp mask U

U = 1 + α(1−B)

02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

mask one

+ 02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

mask one

− 02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

blurring mask

Page 15: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

11/35Unsharp masking — unsharp mask U

U = 1 + α(1−B)

02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

unsharp mask

−0.0044 −0.0053 −0.0061 −0.0067 −0.0071 −0.0073 −0.0071 −0.0067 −0.0061 −0.0053 −0.0044

−0.0053 −0.0063 −0.0073 −0.0080 −0.0085 −0.0087 −0.0085 −0.0080 −0.0073 −0.0063 −0.0053

−0.0061 −0.0073 −0.0083 −0.0092 −0.0098 −0.0100 −0.0098 −0.0092 −0.0083 −0.0073 −0.0061

−0.0067 −0.0080 −0.0092 −0.0102 −0.0108 −0.0110 −0.0108 −0.0102 −0.0092 −0.0080 −0.0067

−0.0071 −0.0085 −0.0098 −0.0108 −0.0115 −0.0117 −0.0115 −0.0108 −0.0098 −0.0085 −0.0071

−0.0073 −0.0087 −0.0100 −0.0110 −0.0117 1.9880 −0.0117 −0.0110 −0.0100 −0.0087 −0.0073

−0.0071 −0.0085 −0.0098 −0.0108 −0.0115 −0.0117 −0.0115 −0.0108 −0.0098 −0.0085 −0.0071

−0.0067 −0.0080 −0.0092 −0.0102 −0.0108 −0.0110 −0.0108 −0.0102 −0.0092 −0.0080 −0.0067

−0.0061 −0.0073 −0.0083 −0.0092 −0.0098 −0.0100 −0.0098 −0.0092 −0.0083 −0.0073 −0.0061

−0.0053 −0.0063 −0.0073 −0.0080 −0.0085 −0.0087 −0.0085 −0.0080 −0.0073 −0.0063 −0.0053

−0.0044 −0.0053 −0.0061 −0.0067 −0.0071 −0.0073 −0.0071 −0.0067 −0.0061 −0.0053 −0.0044

We may combine only masks not the whole images!

Page 16: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

12/35Unsharp masking — Subtract from original

− =

Page 17: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

13/35Unsharp masking — Adding to the original

+ =

Page 18: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

14/35Unsharp masking — Result

Page 19: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

15/35Unsharp masking — Problems with noise

Page 20: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

16/35

Unsharp masking — Problems lossy JPGcompression

Page 21: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

17/35Unsharp masking — revisited

� Often appears in Image manipulation packages (Gimp, ImageMagick).

� It may help in practice. Low-cost lenses blur the image.

� Quite powerful it cannot do miracles, though.

� It also emphasises noise and JPG artifacts.

Page 22: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

18/35Image derivatives

� Measure local image geometry

� Differential geometry a branch of mathematics built around

� We can use convolution to compute them

Page 23: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

18/35Image derivatives

� Measure local image geometry

� Differential geometry a branch of mathematics built around

� We can use convolution to compute them

� First derivative — local changes to the signal. (from physics: speed is

derivative of a position with respect to time)

� Second derivative — changes to change (from physics: acceleration is

. . . )

Page 24: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

19/35Derivative — reminder from calculus

Consider a 1D signal f(x)

d

dxf(x) = lim

h→0

f(x+ h)− f(x)h

Page 25: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

19/35Derivative — reminder from calculus

Consider a 1D signal f(x)

d

dxf(x) = lim

h→0

f(x+ h)− f(x)h

However, for sampled (discrete) signals, the smallest difference h is one. So,

d

dxf(x) ≈ f(x+ 1)− f(x)

1

This called forward difference

Page 26: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

20/35Backward difference

Remind that the limit limh→0

d

dxf(x) = lim

h→0

f(x+ h)− f(x)h

must exist for both limh→0+ and limh→0−

Page 27: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

20/35Backward difference

Remind that the limit limh→0

d

dxf(x) = lim

h→0

f(x+ h)− f(x)h

must exist for both limh→0+ and limh→0−

So going from negative side of h

d

dxf(x) = lim

h→0

f(x)− f(x− h)h

Sampled variantd

dxf(x) ≈ f(x)− f(x− 1)

1

Page 28: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

21/35Kernels for derivatives

Image is 2D function f(x, y). Derivatives may also be along y− direction

Page 29: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

22/35Forward difference — x direction

Page 30: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

23/35Backward difference — x direction

Page 31: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

24/35Central difference — x direction

Page 32: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

25/35Central difference — x and y direction

Page 33: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

26/35Second derivatives

Forwardd

dxf(x) ≈ f(x+ 1)− f(x)

Backwardd

dxf(x) ≈ f(x)− f(x− 1)

Page 34: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

26/35Second derivatives

Forwardd

dxf(x) ≈ f(x+ 1)− f(x)

Backwardd

dxf(x) ≈ f(x)− f(x− 1)

Difference of differences

d2

dx2f(x) ≈ (f(x+ 1)− f(x))− (f(x)− f(x− 1))

= f(x+ 1)− 2f(x) + f(x− 1)

Page 35: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

26/35Second derivatives

Forwardd

dxf(x) ≈ f(x+ 1)− f(x)

Backwardd

dxf(x) ≈ f(x)− f(x− 1)

Difference of differences

d2

dx2f(x) ≈ (f(x+ 1)− f(x))− (f(x)− f(x− 1))

= f(x+ 1)− 2f(x) + f(x− 1)

+1 -1 ∗ +1 -1 = +1 -2 +1

Page 36: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

27/35Second derivatives — derivative of derivative

Page 37: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

28/352D derivatives

Differentiate in one dimension, ignore the other

∂∂x

∂∂y

∂2

∂x2∂2

∂y2

0 0 0

-1 0 +1

0 0 0

0 -1 0

0 0 0

0 +1 0

0 0 0

+1 -2 +1

0 0 0

0 +1 0

0 -2 0

0 +1 0

Page 38: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

29/352D derivatives with smoothing

Differentiate in one dimension and smooth in the other

-1 0 +1 ∗1

1

1

=-1 0 +1

-1 0 +1

-1 0 +1

Page 39: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

29/352D derivatives with smoothing

Differentiate in one dimension and smooth in the other

-1 0 +1 ∗1

1

1

=-1 0 +1

-1 0 +1

-1 0 +1

Page 40: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

30/35The Gradient

∇f(x, y) =

∂f∂x

∂f∂y

� Magnitude

‖∇f(x, y)‖ =

√(∂f

∂x

)2

+(∂f

∂y

)2

,

is steepness in

� direction

ψ = atan

(∂f

∂x,∂f

∂y

),

A way to do the edge detection. Edge direction is perpendicular to ψ.

Page 41: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

31/35The Laplacian

∇2f(x, y) =∂2f

∂x2+∂2f

∂y2

� Sum of second derivatives in x and y directions.

� Sort of an overall curvature.

Page 42: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

31/35The Laplacian

∇2f(x, y) =∂2f

∂x2+∂2f

∂y2

� Sum of second derivatives in x and y directions.

� Sort of an overall curvature.

With kernels:

0 0 0

+1 -2 +1

0 0 0

+0 +1 0

0 -2 0

0 +1 0

=0 +1 0

1 -4 1

0 +1 0

Page 43: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

32/35What is an edge?

75 80 85 90 95 100 105 110−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

0.2

0.25

0.3

x direction

edge profile/5first derivativesecond derivative

105 110 115 120 125 130 135 140 145 150 155−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

0.2

0.25

0.3

y direction

edge profile/5first derivativesecond derivative

Page 44: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

33/35Partial derivatives

Extrema of partial derivatives are good candidates for edges.

Page 45: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

34/35Laplacian

Places where the Laplacian changes from positive to negative are also good

potential edges.

Page 46: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

35/35Laplacian for sharpenning

20 40 60 80 100 120 140 160 180 200

0

100

200

original signal f

0 20 40 60 80 100 120 140 160 180 200−50

0

50

first derivative ∂ f / ∂ x

0 20 40 60 80 100 120 140 160 180 200−100

0

100

Second derivative − Laplacian (scaled) C ∂2 f/∂ x

2

20 40 60 80 100 120 140 160 180 200

0

100

200

improved signal f − C ∂2 f/∂ x

2

sharpened signal ...

... truncated to <0,255>

Page 47: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 48: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 49: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 50: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 51: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 52: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 53: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 54: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 55: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 56: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 57: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

mask one

Page 58: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

mask one

Page 59: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

blurring mask

Page 60: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

02

46

810

0

5

10

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

unsharp mask

Page 61: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

−0.0044 −0.0053 −0.0061 −0.0067 −0.0071 −0.0073 −0.0071 −0.0067 −0.0061 −0.0053 −0.0044

−0.0053 −0.0063 −0.0073 −0.0080 −0.0085 −0.0087 −0.0085 −0.0080 −0.0073 −0.0063 −0.0053

−0.0061 −0.0073 −0.0083 −0.0092 −0.0098 −0.0100 −0.0098 −0.0092 −0.0083 −0.0073 −0.0061

−0.0067 −0.0080 −0.0092 −0.0102 −0.0108 −0.0110 −0.0108 −0.0102 −0.0092 −0.0080 −0.0067

−0.0071 −0.0085 −0.0098 −0.0108 −0.0115 −0.0117 −0.0115 −0.0108 −0.0098 −0.0085 −0.0071

−0.0073 −0.0087 −0.0100 −0.0110 −0.0117 1.9880 −0.0117 −0.0110 −0.0100 −0.0087 −0.0073

−0.0071 −0.0085 −0.0098 −0.0108 −0.0115 −0.0117 −0.0115 −0.0108 −0.0098 −0.0085 −0.0071

−0.0067 −0.0080 −0.0092 −0.0102 −0.0108 −0.0110 −0.0108 −0.0102 −0.0092 −0.0080 −0.0067

−0.0061 −0.0073 −0.0083 −0.0092 −0.0098 −0.0100 −0.0098 −0.0092 −0.0083 −0.0073 −0.0061

−0.0053 −0.0063 −0.0073 −0.0080 −0.0085 −0.0087 −0.0085 −0.0080 −0.0073 −0.0063 −0.0053

−0.0044 −0.0053 −0.0061 −0.0067 −0.0071 −0.0073 −0.0071 −0.0067 −0.0061 −0.0053 −0.0044

Page 62: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 63: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 64: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 65: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 66: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 67: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 68: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 69: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 70: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 71: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 72: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 73: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 74: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 75: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 76: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 77: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 78: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 79: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 80: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 81: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 82: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 83: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 84: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 85: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 86: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 87: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

75 80 85 90 95 100 105 110−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

0.2

0.25

0.3

x direction

edge profile/5first derivativesecond derivative

Page 88: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

105 110 115 120 125 130 135 140 145 150 155−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

0.2

0.25

0.3

y direction

edge profile/5first derivativesecond derivative

Page 89: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 90: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 91: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 92: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges
Page 93: Image preprocessing in spatial domain - CMPcmp.felk.cvut.cz/cmp/courses/E383ZS/XE383ZS... · Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges

20 40 60 80 100 120 140 160 180 200

0

100

200

original signal f

0 20 40 60 80 100 120 140 160 180 200−50

0

50

first derivative ∂ f / ∂ x

0 20 40 60 80 100 120 140 160 180 200−100

0

100

Second derivative − Laplacian (scaled) C ∂2 f/∂ x

2

20 40 60 80 100 120 140 160 180 200

0

100

200

improved signal f − C ∂2 f/∂ x

2

sharpened signal ...

... truncated to <0,255>