Material 3
Material 3
of 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
2
of 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]
3
of 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
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
4
of
Image Enhancement Examples
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
5
of
Image Enhancement Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
6
of
Image Enhancement Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
7
of
Image Enhancement Examples (cont…)
8
of 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
9
of Image Histograms
The histogram of an image shows us the
distribution of grey levels in the image
Massively useful in image processing,
especially in segmentation
Frequencies
Grey Levels
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
10
Histogram Examples
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
11
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
12
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
13
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
14
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
15
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
16
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
17
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
18
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
19
Histogram Examples (cont…)
20
of Histogram Examples (cont…)
A selection of images and
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
their histograms
Notice the relationships
between the images and
their histograms
Note that the high contrast
image has the most
evenly spaced histogram
21
of Contrast Stretching
We can fix images that have poor contrast
by applying a pretty simple contrast
specification
The interesting part is how do we decide on
this transformation function?
22
of Histogram Equalisation
Spreading out the frequencies in an image
(or equalising the image) is a simple way to
improve dark or washed out images
The formula for histogram
equalisation is given where sk = T (rk )
– rk: input intensity k
of
23
Equalisation Transformation Function
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
24
1
Equalisation Examples
25
of Equalisation Transformation Functions
of
26
2
Equalisation Examples
27
of Equalisation Transformation Functions
of
28
4
3
Equalisation Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
29
4
3
Equalisation Examples (cont…)
30
of Equalisation Transformation Functions
Original Negative
s = 1.0 - r
Image Image
36
of
Point Processing Example:
Negative Images (cont…)
Original Image Enhanced Image x
x
s = intensitymax - r
37
of
Point Processing Example:
Thresholding
•Thresholding transformations are
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
39
Intensity Transformations
40
of Basic Grey Level Transformations
•There are many different kinds of grey level
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
transformations
•Three of the most
common are shown
here
– Linear
• Negative/Identity
– Logarithmic
• Log/Inverse log
– Power law
• nth power/nth root
41
of 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
42
of Logarithmic Transformations (cont…)
s = log(1 + r)
43
of Logarithmic Transformations (cont…)
s = log(1 + r)
We usually set c to 1
Grey levels must be in the range [0.0, 1.0]
44
of Power Law Transformations
•Power law transformations have the following
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
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
45
of Power Law Transformations (cont…)
Original Image Enhanced Image x
x
s=rγ
γ = 0.6
1
Transformed Intensities
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 0.8 1
Old Intensities
48
of 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
49
of 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
50
of Power Law Example (cont…)
•The images to the
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
right show a
s = r 0.6
magnetic resonance
(MR) image of a
fractured human
s = r 0.4
spine
•Different curves
highlight different
detail
51
of Power Law Example
52
of 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
53
of Power Law Transformations (cont…)
•An aerial photo
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of a runway is
shown s = r 3.0
•This time
power law
s = r 4.0
transforms are
used to darken
the image
•Different curves
highlight
different detail
54
of Gamma Correction
•Many of you might be familiar with gamma
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
55
More Contrast Issues
56
of
Piecewise Linear Transformation
Functions
•Rather than using a well defined mathematical
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
– Similar to thresholding
– Other levels can be
suppressed or maintained
– Useful for highlighting features
in an image
58
of Image Enhancement
59
of Point Operations
60
of Non Linear Equations
• Square
• Square root
• Logarithm
• Power
61
of Contrast Stretching
62
of Range Normalization
63
of Clipping & Thresholding
64
of Multiple Thresholding
65
of Intensity Slicing
66
of
67
of Bitplane Slicing
68
of Histogram Stretching
69
of
70
of
71
of Histogram Stretching
72
of Histogram Sliding
73
of Histogram Equalization
74
of
75
of Histogram Specification
76
of
77
of
78
of
79
of Bit Plane Slicing
•Often by isolating particular bits of the pixel
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
[10000000] [01000000]
[00100000] [00001000]
[00000100] [00000001]
81
of Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
[10000000] [01000000]
[00100000] [00001000]
[00000100] [00000001]
82
of Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
83
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
84
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
85
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
86
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
87
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
88
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
89
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
90
Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of
91
Bit Plane Slicing (cont…)
92
of Bit Plane Slicing (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
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
93
of
94
of
95
of Summary
•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
96
of Histogram Processing
• Histogram of a digital image with gray levels in
the range [0,L-1] is a discrete function
h(rk) = nk
• Where
– rk : the kth gray level
– nk : the number of pixels in the image having gray
level rk
– h(rk) : histogram of a digital image with gray levels rk
96
97
of Normalized Histogram
• dividing each of histogram at gray level rk by the
total number of pixels in the image, n
p(rk) = nk / n
• For k = 0,1,…,L-1
• p(rk) gives an estimate of the probability of
occurrence of gray level rk
• The sum of all components of a normalized
histogram is equal to 1
97
98
of Histogram Processing
• Basic for numerous spatial domain
processing techniques
• Used effectively for image enhancement
• Information inherent in histograms also is
useful in image compression and
segmentation
98
99 h(rk) or p(rk)
of Example
rk
Dark image
Components of
histogram are
concentrated on the
low side of the gray
scale.
Bright image
Components of
histogram are
concentrated on the
high side of the gray
scale.
99
100
of Example
Low-contrast image
histogram is narrow
and centered toward
the middle of the
gray scale
High-contrast image
101
102
of
Histogram transformation
s s = T(r)
• Where 0 r 1
• T(r) satisfies
– (a). T(r) is single-
sk= T(rk)
valued and
T(r)
monotonically
increasingly in the
interval 0 r 1
– (b). 0 T(r) 1 for
0r1
0 rk 1 r
102
103
of 2 Conditions of T(r)
104
105
of Random Variables
• Random variables often are a source of
confusion when first encountered.
• This need not be so, as the concept of a
random variable is in principle quite
simple.
105
106
of Random Variables
107
108
of Random Variables
• In other words, although typically the
notation used to denote a random variable
is as we have shown it here, x, or some
other appropriate variable,
• to be strictly formal, a random variable
should be written as a function x(·) where
the argument is a specific event being
considered.
108
109
of Random Variables
• However, this is seldom done, and, in our
experience, trying to be formal by using
function notation complicates the issue
more than the clarity it introduces.
• Thus, we will opt for the less formal
notation, with the warning that it must be
keep clearly in mind that random variables
are functions.
109
110
of Random Variables
• Example:
– Consider the experiment of drawing a single
card from a standard deck of 52 cards.
– Suppose that we define the following events.
A: a heart; B: a spade; C: a club; and D: a
diamond, so that S = {A, B, C, D}.
– A random variable is easily defined by letting
x = 1 represent event A, x = 2 represent
event B, and so on.
110
111
of Random Variables
• As a second illustration,
– consider the experiment of throwing a single die and
observing the value of the up-face.
– We can define a random variable as the numerical
outcome of the experiment (i.e., 1 through 6), but
there are many other possibilities.
– For example, a binary random variable could be
defined simply by letting x = 0 represent the event
that the outcome of throw is an even number and
x = 1 otherwise.
111
112
of Random Variables
• Note
– the important fact in the examples just given
that the probability of the events have not
changed;
– all a random variable does is map events
onto the real line.
112
113
of Random Variables
• Thus far we have been concerned with
random variables whose values are
discrete.
• To handle continuous random variables
we need some additional tools.
• In the discrete case, the probabilities of
events are numbers between 0 and 1.
113
114
of Random Variables
• When dealing with continuous quantities
(which are not denumerable) we can no
longer talk about the "probability of an
event" because that probability is zero.
• This is not as unfamiliar as it may seem.
114
115
of Random Variables
• For example,
– given a continuous function we know that the
area of the function between two limits a and
b is the integral from a to b of the function.
– However, the area at a point is zero because
the integral from,say, a to a is zero.
– We are dealing with the same concept in the
case of continuous random variables.
115
116
of Random Variables
• Thus, instead of talking about the probability of a
specific value, we talk about the probability that
the value of the random variable lies in a
specified range.
• In particular, we are interested in the probability
that the random variable is less than or equal to
(or, similarly, greater than or equal to) a
specified constant a.
• We write this as
F(a) = P(x a)
116
117
of Random Variables
• If this function is given for all values of a (i.e., −
< a < ), then the values of random variable x
have been defined.
• Function F is called the cumulative probability
distribution function or simply the cumulative
distribution function (cdf).
• The shortened term distribution function also is
used.
117
118
of Random Variables
119
120
of Random Variables
dF ( x )
p( x ) =
dx
121
122
of Random Variables
122
123
of Random Variables
• The preceding concepts are applicable to
discrete random variables.
• In this case, there is a finite no. of events and we
talk about probabilities, rather than probability
density functions.
• Integrals are replaced by summations and,
sometimes, the random variables are
subscripted.
• For example, in the case of a discrete variable
with N possible values we would denote the
probabilities by P(xi), i=1, 2,…, N.
123
124
of Random Variables
125
126
of Applied to Image
• Let
– pr(r) denote the PDF of random variable r
– ps (s) denote the PDF of random variable s
• If pr(r) and T(r) are known and T-1(s) satisfies
condition (a) then ps(s) can be obtained using a
formula :
dr
p s(s) = p r (r)
ds 126
127
of Applied to Image
129
130
of Finding ps(s) from given T(r)
ds dT ( r )
=
dr dr
dr
p s ( s ) = pr ( r )
r
d
= pr ( w )dw ds
dr 0
1
= pr ( r ) = pr ( r )
pr ( r )
= 1 where 0 s 1
Substitute and yield
130
131
of ps(s)
• As ps(s) is a probability function, it must be
zero outside the interval [0,1] in this case
because its integral over all values of s
must equal 1.
• Called ps(s) as a uniform probability
density function
• ps(s) is always a uniform, independent of
the form of pr(r)
131
132
of r
s = T ( r ) = pr ( w )dw
0
yields
Ps(s)
a random variable s 1
characterized by
a uniform probability
function 0
s
132
133
of
Discrete
transformation function
134
135
of Example
135
136
of Example
136
137
of Example
No. of pixels
6
2 3 3 2 5
4 2 4 3 4
3 2 3 5 3
2
2 4 2 4
1
Gray level
4x4 image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9]
histogram
137
138
of
Gray
0 1 2 3 4 5 6 7 8 9
Level(j)
No. of
0 0 6 5 4 1 0 0 0 0
pixels
k
n
j =0
j 0 0 6 11 15 16 16 16 16 16
k nj 6 11 15 16 16 16 16 16
s= 0 0 / / / / / / / /
j =0 n
16 16 16 16 16 16 16 16
3.3 6.1 8.4
sx9 0 0 9 9 9 9 9
3 6 8
139
of Example
No. of pixels
6
3 6 6 3 5
8 3 8 6 4
6 3 6 9 3
2
3 8 3 8
1
Output image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9] Gray level
Histogram equalization
139
140
of Note
r
s = T ( r ) = pr ( w )dw Histogram equalization
0
142
143
Next, we define a random variable z with the property
of
z
g ( z ) = pz ( t )dt = s Histogram equalization
0
thus
s = T(r) = G(z)
z = G-1(s) = G-1[T(r)]
Assume G-1 exists and satisfies the condition (a) and (b)
144
145
of Procedure Conclusion
3. Obtain the inversed transformation
function G-1
z = G-1(s) = G-1[T(r)]
145
146
of Example
Assume an image has a gray level probability density function pr(r) as shown.
Pr(r)
− 2r + 2 ;0 r 1
pr ( r ) =
2
0 ; elsewhere
1 r
p ( w )dw = 1
0
r
0 1 2 r
146
147
of Example
Pz(z)
2z ;0 z 1
2 pz ( z ) =
0 ; elsewhere
1 z
z
p ( w )dw = 1
0
z
0 1 2
147
148
of Step 1:
z
G ( z ) = ( 2w )dw
z
=z 2
=z 2
0
0
149
150
of Step 3:
G( z ) = T ( r )
z = − r + 2r
2 2
z = 2r − r 2
k
sk = T ( rk ) = pr ( r j )
j =0
k nj
= k = 0 ,1,2 ,..., L − 1
j =0 n
k
G ( z k ) = pz ( z i ) = sk k = 0 ,1,2 ,..., L − 1
i =0
z k = G −1 T ( rk )
=G −1
sk k = 0 ,1,2 ,..., L 151
−1
152
of Example
Result image
after histogram
equalization
Transformation function
Histogram of the result image
for histogram equalization
The histogram equalization doesn’t make the result image look better than
the original image. Consider the histogram of the result image, the net
effect of this method is to map a very narrow interval of dark pixels into
the upper end of the gray scale of the output image. As a consequence, the
output image is light and has a washed-out appearance. 153
154
of Solve the problem
Histogram Equalization
a reasonable approach is to
modify the histogram of that
image so that it does not have
this property
154
155
of
Histogram Specification
k = 0 ,1,2 ,..., L − 1
155
156
of
157
158
of Note
• Histogram processing methods are global
processing, in the sense that pixels are
modified by a transformation function
based on the gray-level content of an
entire image.
• Sometimes, we may need to enhance
details over small areas in an image,
which is called a local enhancement.
158
159 a) Original image
of (slightly blurred to
reduce noise)
b) global histogram
equalization (enhance
noise & slightly
increase contrast but
the construction is
not changed)
c) local histogram
equalization using
7x7 neighborhood
(reveals the small
squares inside larger
ones of the original
image.
(a) (b) (c)
161
162
of Logic Operations
• Logic operation performs on gray-level
images, the pixel values are processed as
binary numbers
• light represents a binary 1, and dark
represents a binary 0
• NOT operation = negative transformation
162
163
of
163
164
of
Example of OR Operation
164
165
of Image Subtraction
165
166 a b
of
c d
Image Subtraction
• a). original fractal image
• b). result of setting the four lower-
order bit planes to zero
– refer to the bit-plane slicing
– the higher planes contribute
significant detail
– the lower planes contribute more
to fine detail
– image b). is nearly identical
visually to image a), with a very
slightly drop in overall contrast
due to less variability of the gray-
level values in the image.
• c). difference between a). and b).
(nearly black)
• d). histogram equalization of c).
(perform contrast stretching
transformation)
166
167
of
169
170
of Image Averaging
• if noise has zero mean and be
uncorrelated then it can be shown that if
K
1
g ( x, y ) =
K
g ( x, y )
i =1
i
170
171
of Image Averaging
• then
1 2
2
g ( x, y ) = ( x, y )
K
2
g ( x, y ) , 2
( x, y ) = variances of g and
if K increase, it indicates that the variability (noise) of the pixel at each location
(x,y) decreases.
171
172
of Image Averaging
• thus
E{g ( x, y)} = f ( x, y)
172
173
of Image Averaging
• Note: the images gi(x,y) (noisy images)
must be registered (aligned) in order to
avoid the introduction of blurring and other
artifacts in the output image.
173
174 a b
of
c d
Example
e f
• a) original image
• b) image corrupted by
additive Gaussian noise
with zero mean and a
standard deviation of 64
gray levels.
• c). -f). results of averaging
K = 8, 16, 64 and 128
noisy images
174
175
of Spatial Filtering
175
176
of Spatial Filtering Process
179
180
of Smoothing Linear Filters
• replacing the value of every pixel in an image by
the average of the gray levels in the
neighborhood will reduce the “sharp” transitions
in gray levels.
• sharp transitions
– random noise in the image
– edges of objects in the image
• thus, smoothing can reduce noises (desirable)
and blur edges (undesirable)
180
181
of 3x3 Smoothing Linear Filters
182
183
of General form : smoothing mask
w(s, t ) f ( x + s, y + t )
g ( x, y ) = s = − at = − b
a b
w(s, t )
s = − at = − b
183
184 a b
of
c d
Example
e f
184
185
of Example
186
187
of Median Filters
• replaces the value of a pixel by the median of
the gray levels in the neighborhood of that pixel
(the original value of the pixel is included in the
computation of the median)
• quite popular because for certain types of
random noise (impulse noise salt and pepper
noise) , they provide excellent noise-reduction
capabilities, with considering less blurring than
linear smoothing filters of similar size.
187
188
of Median Filters
188
189
of Example : Median Filters
189
190
of Sharpening Spatial Filters
• to highlight fine detail in an image
• or to enhance detail that has been blurred,
either in error or as a natural effect of a
particular method of image acquisition.
190
191
of Blurring vs. Sharpening
191
192
of Derivative operator
192
193
of First-order derivative
• a basic definition of the first-order
derivative of a one-dimensional function
f(x) is the difference
f
= f ( x + 1) − f ( x)
x
193
194
of Second-order derivative
• similarly, we define the second-order
derivative of a one-dimensional function
f(x) is the difference
f
2
= f ( x + 1) + f ( x − 1) − 2 f ( x)
x 2
194
195
of
First and Second-order derivative of
f(x,y)
• when we consider an image function of
two variables, f(x,y), at which time we will
dealing with partial derivatives along the
two spatial axes.
f ( x, y ) f ( x, y ) f ( x, y )
Gradient operator f = = +
xy x y
Laplacian operator
f ( x, y) f ( x, y)
2 2
(linear operator) f =
2
+
x 2
y
195
2
196
of Discrete Form of Laplacian
from f 2
= f ( x + 1, y ) + f ( x − 1, y ) − 2 f ( x, y )
x 2
f
2
= f ( x, y + 1) + f ( x, y − 1) − 2 f ( x, y)
y 2
yield,
f = [ f ( x + 1, y ) + f ( x − 1, y )
2
+ f ( x, y + 1) + f ( x, y − 1) − 4 f ( x, y )]
196
197
of Result Laplacian mask
197
198
of
Laplacian mask implemented an
extension of diagonal neighbors
198
199
of
Other implementation of Laplacian
masks
give the same result, but we have to keep in mind that when combining
(add / subtract) a Laplacian-filtered image with another image.
199
200
of Effect of Laplacian Operator
• as it is a derivative operator,
– it highlights gray-level discontinuities in an
image
– it deemphasizes regions with slowly varying
gray levels
• tends to produce images that have
– grayish edge lines and other discontinuities,
all superimposed on a dark,
– featureless background.
200
201
of
Correct the effect of featureless
background
Example
• a). image of the North
pole of the moon
• b). Laplacian-filtered
image with
1 1 1
1 -8 1
1 1 1
203
204
of Mask of Laplacian + addition
g ( x, y ) = f ( x, y ) − [ f ( x + 1, y ) + f ( x − 1, y )
+ f ( x, y + 1) + f ( x, y − 1) + 4 f ( x, y )]
= 5 f ( x, y ) − [ f ( x + 1, y ) + f ( x − 1, y )
+ f ( x, y + 1) + f ( x, y − 1)]
0 -1 0
-1 5 -1
0 -1 0
204
205
of Example
205
206
of Note
f ( x, y ) − 2 f ( x , y )
g ( x, y ) =
f ( x , y ) + 2
f ( x, y )
0 -1 0 0 0 0 0 -1 0
-1 5 -1 = 0 1 0 + -1 4 -1
0 -1 0 0 0 0 0 -1 0
0 -1 0 0 0 0 0 -1 0
-1 9 -1 = 0 1 0 + -1 8 -1
0 -1 0 0 0 0 0 -1 0
206
207
of Unsharp masking
f s ( x, y) = f ( x, y) − f ( x, y)
sharpened image = original image – blurred image
207
208
of High-boost filtering
f hb ( x, y) = Af ( x, y) − f ( x, y)
f hb ( x, y ) = ( A − 1) f ( x, y ) − f ( x, y ) f ( x, y )
= ( A − 1) f ( x, y ) − f s ( x, y )
• generalized form of Unsharp masking
• A1
208
209
of High-boost filtering
f hb ( x, y) = ( A −1) f ( x, y) − f s ( x, y)
• if we use Laplacian filter to create sharpen
image fs(x,y) with addition of original image
f ( x, y ) − f ( x, y )
2
f s ( x, y ) =
f ( x, y ) + f ( x, y )
2
209
210
of High-boost filtering
Af ( x, y ) − f ( x, y )
2
f hb ( x, y ) =
Af ( x, y ) + f ( x, y )
2
◼ A1
◼ if A = 1, it becomes “standard” Laplacian
sharpening 211
212
of Example
212
213 f
of Gradient Operator
Gx x
f = = f
G y
y
= +
x y
f Gx + G y
the magnitude becomes nonlinear
213
214 z2 z3
z1
of Gradient Mask
z4 z5 z6
z7 z8 z9
Gx = ( z8 − z5 ) and G y = ( z 6 − z5 )
1 1
f = [G + G ]
2
x
2
y
2
= [( z8 − z5 ) + ( z6 − z5 ) ]
2 2 2
f z8 − z 5 + z 6 − z 5
214
215 z2 z3
z1
of Gradient Mask
z4 z5 z6
z7 z8 z9
f z 9 − z 5 + z8 − z 6
215
216 z2 z3
z1
of Gradient Mask
z4 z5 z6
z7 z8 z9
216
217
of Note
• the summation of coefficients in all masks
equals 0, indicating that they would give a
response of 0 in an area of constant gray
level.
217
218
of Example
218
219
of
Example of Combining Spatial
Enhancement Methods
• want to sharpen the
original image and
bring out more skeletal
detail.
• problems: narrow
dynamic range of gray
level and high noise
content makes the
image difficult to
enhance
219
220
of
Example of Combining Spatial
Enhancement Methods
• solve :
1. Laplacian to highlight fine detail
2. gradient to enhance prominent
edges
3. gray-level transformation to
increase the dynamic range of
gray levels
220
221
of
221
222
of
222