20
Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Embed Size (px)

Citation preview

Page 1: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Intelligent Vision Systems

ENT 496

Intelligent Vision Systems

ENT 496

Image Filtering and Enhancement

Hema C.R.Lecture 4

Page 2: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

2

Why Filters are needed?• Image processing converts an

input image into an enhanced image from which information about the image can be retrieved.

• To enhance images any unwanted information or distortions called noise has to be removed.

• Filtering is the process which removes noise from an image [which also includes lightening darker regions to enhance quality of the image or suppresses unwanted information /region]

Original Image

Image with Noise

Page 3: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

3

Image Noise• Images are formed by light

falling on a sensor• Noises are introduced due to

– Quantization – which reduces the light levels to 256

– Imperfect sensors– Imperfect lighting conditions

during acquisition– Compression formats

Page 4: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

4

Types of Noise• Salt and Pepper

– In salt and pepper noise, pixels in the image are vastly different in color from their surrounding pixels.

– The color of a noisy pixel bears no relation to the color of surrounding pixels.

– Generally this type of noise will only affect a small number of image pixels.

– When viewed, the image contains dark and white dots, hence the term salt and pepper noise.

. • Gaussian Noise

– In Gaussian noise (dependent noise), an amount of noise is added to every part of the picture.

– Each pixel in the image will be changed from its original value by a (usually) small amount.

– Taking a plot of the amount of distortion of a pixel against the frequency with which it occurs produces a Gaussian distribution of noise

• Uniform Noise– Noise pixel values are usually close to their true values.– Average value is equal to the real one

Original Image

Salt and Pepper Noise

Gaussian Noise

Uniform Noise

Page 5: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

5

Noise Removal• Most Noise removal processes

are called filters– Applied to each point in an image

[convolution]– Use information in the small local

windows of a pixel• Noise removal Filters

– Linear Filters– Non-Linear Filters

• Linear Filters– Gaussian filters– Mean Filter

• Non-Linear Filters– Median Filter

Page 6: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

6

Convolution• Convolution is a neighborhood operation

in which each output pixel is a weighted sum of neighboring input pixels. The weights are defined by the convolution kernel.

• Image processing operations implemented with convolution include filtering , smoothing, sharpening, and edge enhancement.

Page 7: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

7

*

Image (I)

Kernel / mask (K)

Convolution

Page 8: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

8

Convolution

R = K * I

IR

Page 9: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

9

Convolution

R = K * I

I R

Page 10: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

10

Convolution

R = K * I

I R

Page 11: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

11

P1 P2 P3

P4 P5 P6

P7 P8 P9A B C

D E F

G H I

987654321 IPHPGPFPEPDPCPBPAP]j,i[h

Convolution Mask

h [i,j]

Page 12: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

12

Linear Filters

Page 13: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

13

Gaussian Filter• Gaussian filters removes noise by

smoothing but also blurs the image,• The degree of smoothing is

determined by the standard deviation of the Gaussian. (Larger standard deviation Gaussians, of course, require larger convolution masks in order to be accurately represented.)

• The Gaussian outputs a `weighted average' of each pixel's neighborhood, with the average weighted more towards the value of the central pixels.

• This is in contrast to the mean filter's uniformly weighted average.

• Gaussian provides gentler smoothing and preserves edges better than a similarly sized mean filter

2

2

2

2

1

x

exG

- Standard deviation of the distribution

Page 14: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

14

Mean Filter• The mean filter is a simple

sliding-window spatial filter that replaces the center value in the window with the average (mean) of all the pixel values in the window.

• The window, or kernel, is usually square but can be any shape.

• An example of mean filtering of a single 3x3 window of values is as shown in figure

5 3 7

2 6 4

8 1 9

* * *

* 5 *

* * *

Page 15: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

15

Median Filter• The median filter is also a sliding-window

spatial filter, but it replaces the center value in the window with the median of all the pixel values in the window.

• As for the mean filter, the kernel is usually square but can be any shape.

• An example of median filtering of a single 3x3 window of values is shown

• Median filter remove 'impulse' noise (outlying values, either high or low).

• The median filter is also widely claimed to be 'edge-preserving' since it theoretically preserves step edges without blurring.

• However, in the presence of noise it does blur edges in images slightly.

3 57 7

2 5 6

18 4 9

* * *

* 6 *

* * *

2,3,4,5,6,7,9,18,57

Page 16: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

16

Image Enhancement

Page 17: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

17

• Image enhancement is a process aimed at assisting image analysis.

• Images can be regarded as sets of features that are needed for decision making and that are represented in a special way perceivable to the machine.

• Image enhancement frequently requires intentional

distorting image signal such as exaggerating brightness and color contrasts, deliberate removing certain

Page 18: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

18

Histogram Modification• Histogram equalization

– Is a method for stretching contrast of unevenly distributed gray values by uniformly redistributing the gray values

0 100 200

0

200

400

600

800

0 100 200

0

500

1000

Page 19: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Hema ENT 496 Lecture 4

19

References• Computer Vision – Linda G Shapiro &

George Stockman

• http://en.wikipedia.org/wiki/Image_noise

• Mat lab reference notes

Page 20: Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4

Intelligent Vision Systems

Intelligent Vision Systems

End of Lecture 4