EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories...

34
EE663 Image Processing Histogram Equalization I Dr. Samir H. Abdul-Jauwad Electrical Engineering Department College of Engineering Sciences King Fahd University of Petroleum & Minerals Dhahran – Saudi Arabia [email protected]

Transcript of EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories...

Page 1: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

EE663Image Processing

Histogram Equalization IDr. Samir H. Abdul-Jauwad

Electrical Engineering DepartmentCollege of Engineering Sciences

King Fahd University of Petroleum & MineralsDhahran – Saudi [email protected]

Page 2: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Contents

Over the next few lectures we will look at image enhancement techniques working in the spatial domain:

– What is image enhancement?– Different kinds of image enhancement– Histogram processing– Point processing– Neighbourhood operations

Page 3: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

A Note About Grey Levels

So far when we have spoken about image grey level values we have said they are in the range [0, 255]

– Where 0 is black and 255 is whiteThere is no reason why we have to use this range

– The range [0,255] stems from display technologes

For many of the image processing operations in this lecture grey levels are assumed to be given in the range [0.0, 1.0]

Page 4: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

What Is Image Enhancement?

Image enhancement is the process of making images more usefulThe reasons for doing this include:

– Highlighting interesting detail in images– Removing noise from images– Making images more visually appealing

Page 5: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Image Enhancement Examples

Page 6: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Image Enhancement Examples (cont…)

Page 7: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Image Enhancement Examples (cont…)

Page 8: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Image Enhancement Examples (cont…)

Page 9: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Spatial & Frequency Domains

There are two broad categories of image enhancement techniques

– Spatial domain techniques• Direct manipulation of image pixels

– Frequency domain techniques• Manipulation of Fourier transform or wavelet transform of an

image

For the moment we will concentrate on techniques that operate in the spatial domain

Page 10: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Image HistogramsThe histogram of an image shows us the distribution of grey levels in the imageMassively useful in image processing, especially in segmentation

Grey Levels

Freq

uenc

ies

Page 11: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 12: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 13: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 14: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 15: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 16: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 17: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 18: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

Page 19: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram Examples (cont…)

A selection of images and their histogramsNotice the relationships between the images and their histogramsNote that the high contrast image has the most evenly spaced histogram

Page 20: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Histogram EqualisationSpreading out the frequencies in an image (or equalising the image) is a simple way to improve dark or washed out imagesThe formula for histogram equalisation is given where

– rk: input intensity– sk: processed intensity– k: the intensity range

(e.g 0.0 – 1.0)– nj: the frequency of intensity j– n: the sum of all frequencies

)( kk rTs

k

jjr rp

1)(

k

j

j

nn

1

Page 21: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Transformation Function

Page 22: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Examples1

Page 23: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Transformation Functions

The functions used to equalise the images in the previous example

Page 24: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Examples2

Page 25: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Transformation Functions

The functions used to equalise the images in the previous example

Page 26: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Examples (cont…)

3

4

Page 27: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Examples (cont…)

3

4

Page 28: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Equalisation Transformation Functions

The functions used to equalise the images in the previous examples

Page 29: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Contrast Stretching

We can fix images that have poor contrast by applying a pretty simple contrast specificationThe interesting part is how do we decide on this transformation function?

Page 30: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Contrast Stretching

• To increase the dynamic range of the gray levels in the image being processed.

Page 31: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Contrast Stretching

• The locations of (r1,s1) and (r2,s2) control the shape of the transformation function.

– If r1= s1 and r2= s2 the transformation is a linear function and produces no changes.

– If r1=r2, s1=0 and s2=L-1, the transformation becomes a thresholding function that creates a binary image.

Page 32: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Contrast Stretching

• More on function shapes:

– Intermediate values of (r1,s1) and (r2,s2) produce various degrees of spread in the gray levels of the output image, thus affecting its contrast.

– Generally, r1≤r2 and s1≤s2 is assumed.

Page 33: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Contrast Stretching

Page 34: EE 663 Histogram Equalization I - KFUPM...Spatial & Frequency Domains There are two broad categories of image enhancement techniques – Spatial domain techniques • Direct manipulation

Summary

We have looked at:– Different kinds of image enhancement– Histograms– Histogram equalisation

Next time we will start to look at point processing and some neighbourhood operations