Image Processing -Multimedia Design Technologies3rd Lecture
Instructor: Dahlan Nariman Institute of ICT, Ritsumeikan Asia Pacific University Office: B-II Building, Room 373 Phone’s extension number: 4373
1
Contents z 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 {What is point processing? {Negative images {Thresholding {Logarithmic transformation {Power law transforms {Grey level slicing
What Is Image Enhancement? z Image enhancement is the process of making images more useful z The reasons for doing this include: { Highlighting interesting detail in images { Removing noise from images { Making images more visually appealing
Image Enhancement Examples (cont…)
Image Enhancement Examples (cont…)
Spatial & Frequency Domains zThere are two broad categories of image enhancement techniques {Spatial domain techniques zDirect manipulation of image pixels
{Frequency domain techniques zManipulation of Fourier transform or wavelet transform of an image
zwe will concentrate on techniques that operate in the spatial domain
A Note About Grey Levels z So far when we have spoken about image grey level values we have said they are in the range [0, 255] ← (8bits greyscale image) { Where 0 is black and 255 is white Black
white 0
1
2
3
4
………. …..
N
z For many of the image processing operations in this lecture grey levels are assumed to be given in the range [0.0, 1.0] white
Black 0.0
0.1
0.2
0.3
0.4
………. ….. 1.0
Color intensity levels in the image (Gray scale image) Grey intensity levels
Original Object
Black 0
1
3
4
5
5
5
255 255 255
255
65
56
76
255 255
96
96
9
255 255
92
175 210 255 255
90
175 162 165 255
65
white 2
255
10
A Bitmap Image (8bits Grey Scale)
70
6 … ………..255
y
x
Image Histograms
Frequencies
zThe histogram of an image shows us the distribution of grey levels in the image zMassively useful in image processing, especially in segmentation
0 1 2….
Grey Levels
255
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…) z A selection of images and their histograms z Notice the relationships between the images and their histograms z Note that the high contrast image has the most evenly spaced histogram
Histogram Equalisation zSpreading out the frequencies in an image (or equalising the image) is a simple way to improve dark or washed out images s k = T ( rk ) zThe formula for histogram equalisation is given where k {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
= ∑ pr ( r j ) j =1
k
nj
j =1
n
=∑
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Equalisation Transformation Function
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Equalisation Examples 1
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Equalisation Examples 2
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Equalisation Examples (cont…) 3
4
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Equalisation Transformation Functions zThe functions used to equalise the images in the previous examples
Basic Spatial Domain Image Enhancement z Most spatial domain enhancement operations can be reduced to the form Origin x z g (x, y) = T[ f (x, y)] z where f (x, y) is the input image, g (x, y) is the processed image and T is some (x, y) operator defined over some neighbourhood of (x, y) y
Image f (x, y)
Point Processing z The simplest spatial domain operations occur when the neighbourhood is simply the pixel itself z In this case T is referred to as a grey level transformation function or a point processing operation z Point processing operations take the form z s=T(r) z where s refers to the processed image pixel value and r refers to the original image pixel value Original Image
r
y
Image f (x, y)
Enhanced Image
x
s
s = T[ r]
y
Image f (x, y)
x
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Point Processing Example: Negative Images z 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 = intensitymax - r
Original Image
s = 1.0 - r
Negative Image
Point Processing Example: Thresholding z Thresholding transformations are particularly useful for segmentation in which we want to isolate an object of interest from a background
s=
1.0 r > threshold 0.0 r <= threshold
Basic Grey Level Transformations z There are many different kinds of grey level transformations z Three of the most common are shown here {Linear z Negative/Identity
{Logarithmic z Log/Inverse log
{Power law z nth power/nth root
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Logarithmic Transformations (cont…) z Log functions are particularly useful when the input grey level values may have an extremely large range of values z In the following example the Fourier transform of an image is put through a log transform to reveal more detail
s = log(1 + r)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Power Law Transformations z Power law transformations have the following form z s=c*rγ z Map a narrow range of dark input values into a wider range of output values or vice versa z Varying γ gives a whole family of curves
Power Law Example (cont…)
Original image
Transformed Intensities
γ = 0.3 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0
0.2
0.4
0.6
Original Intensities
0.8
1
z The images to the right show a magnetic resonance (MR) image of a fractured human spine z Different curves highlight different detail
s = r 0.6
s = r 0.4
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Power Law Example (cont…)
s=
r
0.3
Power Law Example
Power Law Example (cont…)
Transformed Intensities
γ = 5.0 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0
0.2
0.4
0.6
Original Intensities
0.8
1
z An aerial photo of a runway is shown z This time power law transforms are used to darken the image z Different curves highlight different detail
s = r 3.0
s = r 4.0
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Power Law Transformations (cont…)
s=
r
5.0
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Gray Level Slicing zHighlights a specific range of grey levels {Similar to thresholding {Other levels can be suppressed or maintained {Useful for highlighting features in an image
Working with Photoshop for processing a digital image
Summary zWe have looked at: {Different kinds of image enhancement {Histograms {Histogram equalisation {Different kinds of point processing image enhancement
Exercise Grey intensity levels of an original image
Negative image and thresholding transformations are defined by the following equations:
x 255 175
85
215 125 240 10
y
25
40
a pixel’s intensity level
•Negative Image:
s = intensitymax - r •Thresholding:
s=
1.0 , r > threshold 0.0 , r <= threshold
where s refers to the processed image pixel value and r refers to the original image pixel value.
1) Calculate pixels’ intensity levels of the negative image processed from the left side original image! 2) Calculate pixels’ intensity levels of thresholding transformation image, when the threshold’s value is 200.