Digital Image Processing - BU

45
Digital Image Processing Image Enhancement (Point Processing)

Transcript of Digital Image Processing - BU

Page 1: Digital Image Processing - BU

Digital Image Processing

Image Enhancement

(Point Processing)

Page 2: Digital Image Processing - BU

2

of

45Contents

In this lecture we will look at image

enhancement point processing techniques:

– What is point processing?

– Negative images

– Thresholding

– Logarithmic transformation

– Power law transforms

– Grey level slicing

– Bit plane slicing

Page 3: Digital Image Processing - BU

3

of

45

Basic Spatial Domain Image

Enhancement

Origin x

y Image f (x, y)

(x, y)

Most spatial domain enhancement operations

can be reduced to the form

g (x, y) = T[ f (x, y)]

where f (x, y) is the

input image, g (x, y) is

the processed image

and T is some

operator defined over

some neighbourhood

of (x, y)

Page 4: Digital Image Processing - BU

4

of

45Point Processing

The simplest spatial domain operations occur when the neighbourhood is simply the pixel itself

In this case T is referred to as a grey level transformation function or a point processing operation

Point processing operations take the form

s = T ( r )

where s refers to the processed image pixel

value and r refers to the original image pixel value

Page 5: Digital Image Processing - BU

5

of

45

Point Processing Example:

Negative Images

Negative images are useful for enhancing

white or grey detail embedded in dark

regions of an image

– Note how much clearer the tissue is in the

negative image of the mammogram below

s = 1.0 - rOriginal

Image

Negative

Image

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 6: Digital Image Processing - BU

6

of

45

Point Processing Example:

Negative Images (cont…)

Original Image x

y Image f (x, y)

Enhanced Image x

y Image f (x, y)

s = intensitymax - r

Page 7: Digital Image Processing - BU

7

of

45

Point Processing Example:

Thresholding

Thresholding transformations are particularly

useful for segmentation in which we want to

isolate an object of interest from a

background

s = 1.0

0.0 r <= threshold

r > threshold

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 8: Digital Image Processing - BU

8

of

45

Point Processing Example:

Thresholding (cont…)

Original Image x

y Image f (x, y)

Enhanced Image x

y Image f (x, y)

s = 0.0 r <= threshold

1.0 r > threshold

Page 9: Digital Image Processing - BU

9

of

45Intensity Transformations

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 10: Digital Image Processing - BU

10

of

45Basic Grey Level Transformations

There are many different kinds of grey level

transformations

Three of the most

common are shown

here

– Linear

• Negative/Identity

– Logarithmic

• Log/Inverse log

– Power law

• nth power/nth rootIma

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 11: Digital Image Processing - BU

11

of

45Logarithmic Transformations

The general form of the log transformation is

s = c * log(1 + r)

The log transformation maps a narrow range

of low input grey level values into a wider

range of output values

The inverse log transformation performs the

opposite transformation

Page 12: Digital Image Processing - BU

12

of

45Logarithmic Transformations (cont…)

Log functions are particularly useful when the input grey level values may have an extremely large range of values

In the following example the Fourier transform of an image is put through a log transform to reveal more detail

s = log(1 + r)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 13: Digital Image Processing - BU

13

of

45Logarithmic Transformations (cont…)

Original Image x

y Image f (x, y)

Enhanced Image x

y Image f (x, y)

s = log(1 + r)

We usually set c to 1

Grey levels must be in the range [0.0, 1.0]

Page 14: Digital Image Processing - BU

14

of

45Power Law Transformations

Power law transformations have the following

form

s = c * r γ

Map a narrow range

of dark input values

into a wider range of

output values or vice

versa

Varying γ gives a whole

family of curvesIma

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 15: Digital Image Processing - BU

15

of

45Power Law Transformations (cont…)

We usually set c to 1

Grey levels must be in the range [0.0, 1.0]

Original Image x

y Image f (x, y)

Enhanced Image x

y Image f (x, y)

s = r γ

Page 16: Digital Image Processing - BU

16

of

45Power Law Example

Page 17: Digital Image Processing - BU

17

of

45Power Law Example (cont…)

γ = 0.6

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1

Old Intensities

Tra

nsfo

rmed

In

ten

sit

ies

Page 18: Digital Image Processing - BU

18

of

45Power Law Example (cont…)

γ = 0.4

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1

Original Intensities

Tra

nsfo

rmed

In

ten

sit

ies

Page 19: Digital Image Processing - BU

19

of

45Power Law Example (cont…)

γ = 0.3

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1

Original Intensities

Tra

nsfo

rmed

In

ten

sit

ies

Page 20: Digital Image Processing - BU

20

of

45Power Law Example (cont…)

The images to the

right show a

magnetic resonance

(MR) image of a

fractured human

spine

Different curves

highlight different

detail

s = r 0.6

s = r 0

.4

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 21: Digital Image Processing - BU

21

of

45Power Law Example

Page 22: Digital Image Processing - BU

22

of

45Power Law Example (cont…)

γ = 5.0

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1

Original Intensities

Tra

nsfo

rmed

In

ten

sit

ies

Page 23: Digital Image Processing - BU

23

of

45Power Law Transformations (cont…)

An aerial photo of a runway is shown

This time power law transforms are used to darken the image

Different curves highlight different detail

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

s = r 3.0

s = r 4

.0

Page 24: Digital Image Processing - BU

24

of

45Gamma Correction

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

• Different camera sensors- Have different responses to light intensity

- Produce different electrical signals for same input

• How do we ensure there is consistency in:a)Images recorded by different cameras for given light input

b)Light emitted by different display devices for same image?

Page 25: Digital Image Processing - BU

25

of

45Gamma Correction

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

• What is the relation between: Camera: Light on sensor vs. “intensity” of corre

sponding pixel

Display: Pixel intensity vs. light from that pixel

• Relation between pixel value and corre

sponding physical quantity is usually

complex, nonlinear

Page 26: Digital Image Processing - BU

26

of

45Gamma Correction

Many of you might be familiar with gamma

correction of computer monitors

Problem is that

display devices do

not respond linearly

to different

intensities

Can be corrected

using a log

transform

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 27: Digital Image Processing - BU

27

of

45Gamma Correction

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 28: Digital Image Processing - BU

28

of

45More Contrast Issues

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 29: Digital Image Processing - BU

29

of

45

Piecewise Linear Transformation

Functions

Rather than using a well defined mathematical function we can use arbitrary user-defined transforms

The images below show a contrast stretching linear transform to add contrast to a poor quality image

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 30: Digital Image Processing - BU

30

of

45Gray Level Slicing

Highlights a specific range of grey levels

– Similar to thresholding

– Other levels can be

suppressed or maintained

– Useful for highlighting features

in an image

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 31: Digital Image Processing - BU

31

of

45Bit Plane Slicing

Often by isolating particular bits of the pixel

values in an image we can highlight

interesting aspects of that image

– Higher-order bits usually contain most of the

significant visual information

– Lower-order bits contain

subtle details

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 32: Digital Image Processing - BU

32

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

[10000000] [01000000]

[00100000] [00001000]

[00000100] [00000001]

Page 33: Digital Image Processing - BU

33

of

45Bit Plane Slicing (cont…)

Page 34: Digital Image Processing - BU

34

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 35: Digital Image Processing - BU

35

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 36: Digital Image Processing - BU

36

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 37: Digital Image Processing - BU

37

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 38: Digital Image Processing - BU

38

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 39: Digital Image Processing - BU

39

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 40: Digital Image Processing - BU

40

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 41: Digital Image Processing - BU

41

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 42: Digital Image Processing - BU

42

of

45Bit Plane Slicing (cont…)

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 43: Digital Image Processing - BU

43

of

45Bit Plane Slicing (cont…)

Reconstructed image

using only bit planes 8

and 7

Reconstructed image

using only bit planes 8, 7

and 6

Reconstructed image

using only bit planes 7, 6

and 5

Ima

ge

s ta

ke

n fro

m G

on

za

lez &

Wood

s, D

igita

l Im

age

Pro

ce

ssin

g (

20

02

)

Page 44: Digital Image Processing - BU

44

of

45Report

Histogram Specification

Page 45: Digital Image Processing - BU

45

of

45Summary

We have looked at different kinds of point

processing image enhancement

Next time we will start to look at

neighbourhood operations – in particular

filtering and convolution