DIP 3 ImageEnhancement (PointProcessing)
DIP 3 ImageEnhancement (PointProcessing)
(Point Processing)
2
of
49
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
– Point processing
– Histogram processing
– Neighbourhood operations
3
of
49
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 white
There 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]
4
of
49
What Is Image Enhancement?
Image enhancement is the process of
making images more useful
The reasons for doing this include:
– Highlighting interesting detail in images
– Removing noise from images
– Making images more visually appealing
5
of
49
Image Enhancement Examples
6
of
49
Image Enhancement Examples (cont…)
7
of
49
Image Enhancement Examples (cont…)
8
of
49
Image Enhancement Examples (cont…)
9
of
49
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
10
of
Basic Spatial Domain Image
49 Enhancement
Most spatial domain enhancement operations
can be reduced to the form
Origin x
g (x, y) = T[ f (x, y)]
where f (x, y) is the
input image, g (x, y) is
the processed image (x, y)
and T is some
operator defined over
some neighbourhood
of (x, y) y Image f (x, y)
11
of
49
Point processing
Original Negative
s = 1.0 - r
Image Image
14
of
Point Processing Example:
49 Negative Images (cont…)
Original Image Enhanced Image x
x
s = intensitymax - r
15
of
Point Processing Example:
49 Thresholding
Thresholding transformations are particularly
useful for segmentation in which we want to
isolate an object of interest from a
background
We can easily write our own function to perform piecewise linear stretching as shown in
Fig. To do this, we will make use of the find function, to find the pixel values in the image
between ai and ai+1. Since the line between the coordinates (ai, bi) and (ai+1,bi+1) has the
equation.
We can create a function to do the piecewise linear stretching
20
of
49
Grey 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
21
of
49
Basic 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 root
22
of
49
Logarithmic 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
23
of
49
Logarithmic Transformations (cont…)
s = log(1 + r)
24
of
49
Logarithmic Transformations (cont…)
s = log(1 + r)
We usually set c to 1
Grey levels must be in the range [0.0, 1.0]
25
of
49
Power 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 curves
26
of
49
Power Law Transformations (cont…)
Original Image Enhanced Image x
x
s=rγ
We usually set c to 1
Grey levels must be in the range [0.0, 1.0]
27
of
49
Power Law Example
28
of
49
Power Law Example (cont…)
γ = 0.6
1
0.9
0.8
Transformed Intensities
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Old Intensities
29
of
49
Power Law Example (cont…)
γ = 0.4
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
30
of
49
Power Law Example (cont…)
γ = 0.3
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
31
of
49
Power Law Example (cont…)
The images to the
right show a
s = r 0.6
magnetic resonance
(MR) image of a
fractured human s=
r
s = r 0.4
0 .3
spine
Different curves
highlight different
detail
32
of
49
Power Law Example
33
of
49
Power Law Example (cont…)
γ = 5.0
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
34
of
49
Power Law Transformations (cont…)
An aerial photo
of a runway is
shown s = r 3.0
This time
power law
transforms are
s = r 4.0
s=
r 5 .0
used to darken
the image
Different curves
highlight
different detail
35
of
49
Gamma 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
36
of
49
Bit 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
37
of
49
Bit Plane Slicing (cont…)
[10000000] [01000000]
[00100000] [00001000]
[00000100] [00000001]
38
of
49
Bit Plane Slicing (cont…)
39
of
49
Bit Plane Slicing (Bits 0…7)
40
of
49
Bit Plane Slicing (Bits 0)
41
of
49
Bit Plane Slicing (Bits 1)
42
of
49
Bit Plane Slicing (Bits 2)
43
of
49
Bit Plane Slicing (Bits 3)
44
of
49
Bit Plane Slicing (Bits 4)
45
of
49
Bit Plane Slicing (Bits 5)
46
of
49
Bit Plane Slicing (Bits 6)
47
of
49
Bit Plane Slicing (Bits 7)
48
of
49
Bit 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
49
of
49
Summary
We have looked at different kinds of point
processing image enhancement
Next time we will start to look at image
Histogram processing then neighbourhood
operations – in particular filtering and
convolution
1. Wavelet and DIP
2. Image Segmentation(Thresholding)
3. Image Segmentation(Points,Lines)
4. Image Degradation models
5. Image Restoration
6. Graphics Processing Unit GPU
7. Computer vision
8. 3d scanner`
9. Image Lossy Compression (Predictive)
10. Image Lossy Compression (Wavelet )
11. Image Lossy Compression (Variable-Length)
12. Image lossless Compression (LZW)
13. Image lossless Compression (Predictive)
14. Morphological Image Processing
15. Color models
16. Image file format
17. Image Processor
18. Dilation and erosion
19. Opening and closing
20. The Hough transform
21. The distance transform
22. The hit-or-miss transform