Resmi N.G.

Reference:
Digital Signal Processing
Rafael C. Gonzalez
Richard E. Woods
Overview
Spatial Domain Methods
Point Processing
Linear (Image Negatives and Identity)
Logarithmic (Log and Inverse Log)
Power Law (n
th
power and n
th
root)
Piece-wise Linear
Contrast Stretching
Gray-Level Slicing
Bit-Plane Slicing
Histogram Processing
Histogram Equalization
Histogram Matching or Histogram Specification
Enhancement using Arithmetic/ Logic Operations
Image Subtraction
Image Averaging
3/20/2012 CS04 804B Image Processing - Module2 2
Linear Spatial Filtering
Non-Linear Spatial Filtering
Smoothing Spatial Filters
Smoothing Linear Filters
Box-Filter
Weighted Average Filter
Order-Statistics Filters (Non-Linear Spatial Filters)
Median Filter Median Filter
Max-filter
Min-filter
Sharpening Spatial Filters
Second-Order Derivatives
Laplacian
High Boost Filtering and its Application
3/20/2012 CS04 804B Image Processing - Module2 3
Image Enhancement
To process an image so that the result is more suitable
than the original image for a specific application.
Two categories: Two categories:
Spatial domain methods
Direct manipulation of pixels
Frequency domain methods
Modifying the Fourier Transform of an image.
3/20/2012 4 CS04 804B Image Processing - Module2
Spatial Domain Methods
Point Processing
Linear (Image Negatives and Identity)
Logarithmic (Log and Inverse Log)
Power Law (n
th
power and n
th
root)
Piece-wise Linear
Contrast Stretching
Gray-Level Slicing
Bit-Plane Slicing
Histogram Processing
Histogram Equalization
Histogram Matching or Histogram Specification
Enhancement using Arithmetic/ Logic Operations
Image Subtraction
Image Averaging
3/20/2012 CS04 804B Image Processing - Module2 5
Spatial Domain Methods
Operates directly on pixels.
Denoted by the expression
g(x,y) = T[f(x,y)] g(x,y) = T[f(x,y)]
where f(x,y) is the input image, g(x,y) is the processed
image, T is an operator on f defined over some
neighbourhood of (x,y).
T can also operate on a set of input images.
3/20/2012 6 CS04 804B Image Processing - Module2
Neighbourhood – square or rectangular sub-image
area centred at (x,y).
T is applied at each (x,y) to obtain output g at that
location.
3/20/2012 7 CS04 804B Image Processing - Module2
Simplest form of T –
when neighbourhood is of size 1x1 (a single pixel).
g depends only on the value of f at (x,y)
s = T(r)
Enhancement at any point in an image depends only on the
gray level at that point (Point Processing or Gray-Level
Transformation).
Larger neighbourhoods – Mask Processing or Spatial
Filtering.
3/20/2012 8 CS04 804B Image Processing - Module2
Spatial Domain Methods
Point Processing
Linear (Image Negatives and Identity)
Logarithmic (Log and Inverse Log)
Power Law (n
th
power and n
th
root)
Piece-wise Linear
Contrast Stretching
Gray-Level Slicing
Bit-Plane Slicing
Histogram Processing
Histogram Equalization
Histogram Matching or Histogram Specification
Enhancement using Arithmetic/ Logic Operations
Image Subtraction
Image Averaging
3/20/2012 CS04 804B Image Processing - Module2 9
Gray Level Transformations
Three basic types:
Linear (Image Negatives and Identity) Linear (Image Negatives and Identity)
Logarithmic (Log and Inverse Log)
Power Law (n
th
power and n
th
root)
3/20/2012 10 CS04 804B Image Processing - Module2
3/20/2012 CS04 804B Image Processing - Module2 11
Image Negatives
The negative of an image with gray levels in the range
[0,L-1] is obtained by using the transformation given by
s = L-1-r
Reverses the intensity levels of an image.
For enhancing gray or white detail embedded in dark
regions of an image.
3/20/2012 CS04 804B Image Processing - Module2 12
Log Transformation
General form: s = c log(1+r)
where c is a constant and r ≥ 0.
Maps a narrow range of low-level gray values in the input
image into a wider range of output levels. image into a wider range of output levels.
Maps a wide range of high-level gray values in the input image
into a lower range of output levels.
For expanding the values of dark pixels while compressing
higher-level values.
Compresses the dynamic range of images with large variations
in pixel values.
3/20/2012 CS04 804B Image Processing - Module2 13
3/20/2012 CS04 804B Image Processing - Module2 14
Power-Law Transformation
Basic form:s = cr
γ
where c and γ are positive constants.
Power-law curves with fractional values of γ (γ <1)
produces similar effect as log transformation. produces similar effect as log transformation.
Power-law curves with γ >1 have exactly the opposite
effect as compared to those with γ <1.
When c = γ = 1, it reduces to identity transformation.
Gamma correction-
General purpose contrast manipulation-
3/20/2012 CS04 804B Image Processing - Module2 15
3/20/2012 CS04 804B Image Processing - Module2 16
Spatial Domain Methods
Point Processing
Linear (Image Negatives and Identity)
Logarithmic (Log and Inverse Log)
Power Law (n
th
power and n
th
root)
Piece-wise Linear
Contrast Stretching
Gray-Level Slicing
Bit-Plane Slicing
Histogram Processing
Histogram Equalization
Histogram Matching or Histogram Specification
Enhancement using Arithmetic/ Logic Operations
Image Subtraction
Image Averaging
3/20/2012 CS04 804B Image Processing - Module2 17
Piecewise-Linear Transformations
Contrast Stretching
Gray-Level Slicing
Bit-Plane Slicing
Advantage – Piecewise functions can be complex.
Disadvantage – Specification requires more user input.
3/20/2012 CS04 804B Image Processing - Module2 18
Contrast Stretching
Increases the dynamic range of gray levels in input
image.
Causes for low contrast images: Causes for low contrast images:
Poor illumination
Lack of dynamic range in imaging sensor
Wrong setting of lens aperture during image
acquisition.
3/20/2012 CS04 804B Image Processing - Module2 19
3/20/2012 CS04 804B Image Processing - Module2 20
3/20/2012 CS04 804B Image Processing - Module2 21
Gray-Level Slicing
Highlights a specific range of gray levels in an image.
Approach 1 - Assigns a high value for all gray levels in
the range of interest and a low value for all other gray the range of interest and a low value for all other gray
levels.
Produces binary image.
Approach 2 – Brightens the desired range of gray levels
but preserves the background and gray-level tonalities in
the image.
3/20/2012 CS04 804B Image Processing - Module2 22
3/20/2012 CS04 804B Image Processing - Module2 23
3/20/2012 CS04 804B Image Processing - Module2 24
Bit-Plane Slicing
Highlights the contribution made to total image
appearance by specific bits.
Useful in analyzing the relative importance of each bit of Useful in analyzing the relative importance of each bit of
the image.
Helps to determine the number of bits used to quantize
each pixel.
Useful for image compression.
3/20/2012 CS04 804B Image Processing - Module2 25
3/20/2012 CS04 804B Image Processing - Module2 26
3/20/2012 CS04 804B Image Processing - Module2 27
3/20/2012 CS04 804B Image Processing - Module2 28
Spatial Domain Methods
Point Processing
Linear (Image Negatives and Identity)
Logarithmic (Log and Inverse Log)
Power Law (n
th
power and n
th
root)
Piece-wise Linear
Contrast Stretching
Gray-Level Slicing
Bit-Plane Slicing
Histogram Processing
Histogram Equalization
Histogram Matching or Histogram Specification
Enhancement using Arithmetic/ Logic Operations
Image Subtraction
Image Averaging
3/20/2012 CS04 804B Image Processing - Module2 29
Histogram Processing
Contrast adjustment is done using histogram of an image.
Intensities can be better distributed.
Advantage – invertible; if histogram equalization function
is known, the original image can be recovered.
Disadvantage – May increase the contrast of background
noise.
3/20/2012 CS04 804B Image Processing - Module2 30
Histogram Equalization
Automatically determines a transformation function to
produce image with a uniform histogram.
Histogram Matching/ Histogram Specification
Produces an output image with a specified histogram.
3/20/2012 CS04 804B Image Processing - Module2 31
Histogram
Histogram of a digital image with gray levels in the range
[0, L-1] is a discrete function h(r
k
) = n
k
where r
k
is the k
th
gray level.
p(r
k
) is the probability of occurrence of gray level r
k
.
3/20/2012 CS04 804B Image Processing - Module2 32
3/20/2012 CS04 804B Image Processing - Module2 33
3/20/2012 CS04 804B Image Processing - Module2 34
High contrast image
– histogram covers a broad range of the grayscale.
- distribution of pixels nearly uniform. - distribution of pixels nearly uniform.
- exhibits large variety of gray tones.
3/20/2012 CS04 804B Image Processing - Module2 35
Histogram Equalization
: ; [0,1]
: ; [0,1]
:
r gray level of input image r
s gray level of output image s
T Transformation function

T(r) satisfies the conditions:
a) T(r) is single-valued and monotonically increasing in the
interval 0 ≤ r ≤ 1.
b) 0 ≤ T(r) ≤ 1 for 0 ≤ r ≤ 1.
3/20/2012 CS04 804B Image Processing - Module2 36
:
( ); 0 1
T Transformation function
s T r r = ≤ ≤
Condition (a) that T(r) be single-valued guarantees that an
inverse transformation exists.
( f(x) = x
2
is non-invertible for domain of real numbers.)
Invesre transformation from s to r:
r = T
-1
(s), 0 ≤ s ≤ 1
Monotonicity condition preserves the increasing order
from black to white in the output image.
Condition (b) guarantees that the output image gray levels
will be in the same range as the input levels.
3/20/2012 CS04 804B Image Processing - Module2 37
3/20/2012 CS04 804B Image Processing - Module2 38
1
( ) :
( ) :
( ) ( ) ( ) ( ),
( ) ( ) (1)
r
s
r
s r
p r probability density functionof r
p s probability density functionof s
If p r and T r are knownand T s satisfies a then
dr
p s p r
ds

= − − −
3/20/2012 CS04 804B Image Processing - Module2 39
0
( ) ( ) (1)
( ) ( ) (2)
s r
r
r
ds
Atransformation functionhas the form
s T r p w dw
RHS is
= = − − −

. thecumulative distribution functionof r
( ), ( ) (1).
, ( )
( )
( )
s
r
r
GivenT r are known p s canbeobtained using
We know s T r
ds dT r
dr dr
d
p w dw
dr
=
=
(
=
(
¸ ¸

3/20/2012 CS04 804B Image Processing - Module2 40
0
0
( )
( ) (3)
( ' : . . .
r
r
r
dr
d
p w dw
dr
p r
Leibniz s rule derivativeof a definiteintegral wr t
its upper limit is theintegrand evaluat
(
¸ ¸
=
= − − −

.) ed at that limit
(3) (1)
( ) ( )
1
( )
( )
s r
r
Substituting in gives
dr
p s p r
ds
p r
p r
=
=
3/20/2012 CS04 804B Image Processing - Module2 41
( )
1; 0 1
( ) :
.
( ).
r
s
r
p r
s
p s is therefore
always auniform probability density function
independent of p r
= ≤ ≤

3/20/2012 CS04 804B Image Processing - Module2 42
Discrete Version:
(3) (1)
( ) , 0,1,..., 1
( ) ( )
k
r k
k
Substituting in gives
n
p r k L
n
s T r p r
= = −
= =

3/20/2012 CS04 804B Image Processing - Module2 43
0
0
( ) ( )
, 0,1,..., 1
.
k k r j
j
k
j
j
s T r p r
n
k L
n
This transformationis called histogramequalization
=
=
= =
= = −

3/20/2012 CS04 804B Image Processing - Module2 44
3/20/2012 45 CS04 804B Image Processing - Module2
3/20/2012 46 CS04 804B Image Processing - Module2
3/20/2012 47 CS04 804B Image Processing - Module2
Histogram Matching
To generate an image that has a specified histogram.
:
:
( ) :
r
r gray level of input image
z gray level of output image
p r pdf of input image
3/20/2012 CS04 804B Image Processing - Module2 48
0
0
( ) :
( ) :
( ) ( ) (1)
( ) ( ) (2)
r
z
r
r
z
z
p r pdf of input image
p z specified pdf of output image
Let s T r p w dw
Define G z p t dt s
= = − − −
= = − − −

1 1
(1) (2),
( ) ( )
( ) [ ( )] (3)
From and
G z T r
and z must satisfy thecondition
z G s G T r
− −
=
= = − − −
T(r) can be obtained from (1) once p
r
(r) has been
estimated.
G(z) can be obtained from (2) because p
z
(z) is given.
3/20/2012 CS04 804B Image Processing - Module2 49
( ) [ ( )] (3) z G s G T r = = − − −
Assume G
-1
exists and satisfies (a) and (b). Image with
specified histogram can then be obtained as follows:
Obtain the transformation function T(r) using (1).
Use (2) to obtain the transformation function G(z).
Obtain the inverse transformation function G
-1
.
Obtain the output image by applying (3) to all the pixels in
the input image.
The resultant image will have gray levels z with specified
probabilitiy density function p
z
(z).
3/20/2012 CS04 804B Image Processing - Module2 50
Discrete formulation:
0
0
( ) ( )
, 0,1,..., 1
k
k k r j
j
k
j
j
k
s T r p r
n
k L
n
=
=
= =
= = −

3/20/2012 CS04 804B Image Processing - Module2 51
0
1
1
( ) ( )
[ ( )], 0,1,..., 1
,
( ), 0,1,..., 1
k
k k z i k
i
k k
k k
v G z p z s
z G T r k L
Or
z G s k L
=

= = =
= = −
= = −

3/20/2012 52 CS04 804B Image Processing - Module2
3/20/2012 53 CS04 804B Image Processing - Module2
Global and Local Enhancement
Global – pixels are modified based on the gray level
content of entire image.
Local – pixels are modified based on the gray level
distribution in the neighbourhood of every pixel.
3/20/2012 CS04 804B Image Processing - Module2 54
Use of Histogram Statistics
Global mean – measure of average gray level for entire
image.
Local mean – measure of average gray level in the
neighborhood (sub-image). neighborhood (sub-image).
Global variance – measure of contrast for entire image.
Local variance – measure of contrast in a
neighborhood.
3/20/2012 CS04 804B Image Processing - Module2 55
Spatial Domain Methods
Point Processing
Linear (Image Negatives and Identity)
Logarithmic (Log and Inverse Log)
Power Law (n
th
power and n
th
root)
Piece-wise Linear
Contrast Stretching
Gray-Level Slicing
Bit-Plane Slicing
Histogram Processing
Histogram Equalization
Histogram Matching or Histogram Specification
Enhancement using Arithmetic/ Logic Operations
Image Subtraction
Image Averaging
3/20/2012 CS04 804B Image Processing - Module2 56
Enhancement using
Arithmetic/Logical Operations
Arithmetic – operations are performed on a pixel-by-pixel
basis on two or more images.
Logical – operations are performed on a pixel-by-pixel Logical – operations are performed on a pixel-by-pixel
basis and pixel values are processed as strings of binary
numbers.
AND and OR – on two or more images
To highlight an area or differentiate it from rest of the image.
NOT – on single image.
3/20/2012 CS04 804B Image Processing - Module2 57
AND Operation
OR Operation
3/20/2012 58 CS04 804B Image Processing - Module2
Image Subtraction
The difference between two images f(x,y) and h(x,y) is
obtained by computing the difference between all pairs of
corresponding pixels from f and h.
g(x,y) = f(x,y) – h(x,y)
Used to enhance differences between images.
Used in medical imaging.
3/20/2012 CS04 804B Image Processing - Module2 59
Image Averaging
Let g(x,y) be a noisy image formed by the addition of
noise η(x,y) to an image f(x,y). ie;
g(x,y) = f(x,y) + η(x,y)
Assume noise has zero average value. Assume noise has zero average value.
The noise content in the image can be reduced by adding a
set of noisy images and taking the average
3/20/2012 CS04 804B Image Processing - Module2 60
1
1
( , ) ( , )
K
i
i
g x y g x y
K
=
=

Expected value of , { ( , )} ( , ) g E g x y f x y =
Linear Spatial Filtering
Non-Linear Spatial Filtering
Smoothing Spatial Filters
Smoothing Linear Filters
Box-Filter
Weighted Average Filter
Order-Statistics Filters (Non-Linear Spatial Filters)
Median Filter Median Filter
Max-filter
Min-filter
Sharpening Spatial Filters
Second-Order Derivatives
Laplacian
High Boost Filtering and its Application
3/20/2012 CS04 804B Image Processing - Module2 61
Spatial Filtering
Uses image pixels in the neighborhood (sub-image).
Values in a sub-image are called coefficients. Values in a sub-image are called coefficients.
Filtering consists of moving the mask from point to point
in an image. At each point (x,y) response of the filter is
computed using a predefined relationship.
3/20/2012 CS04 804B Image Processing - Module2 62
Linear Spatial Filtering
This involves finding sum of products of filter coefficients
and corresponding pixels in the sub-image.
3/20/2012 CS04 804B Image Processing - Module2 63
3/20/2012 CS04 804B Image Processing - Module2 64
Linear filtering of an image f of size MxN with a filter of
size mxn, is given by
( , ) ( , ) ( , )
a b
s a t b
g x y w s t f x s y t
=− =−
= + +
∑ ∑
3/20/2012 CS04 804B Image Processing - Module2 65
1 1
, ,
2 2
0,1,..., 1 0,1,..., 1.
m n
where a b
for x M and y N
− −
= =
= − = −
1 1
1 1
3
3 1 3 1
1, 1
2 2
( , ) ( , ) ( , )
s t
m n
a b
g x y w s t f x s y t
=− =−
= =
− −
∴ = = = =
= + +
∑ ∑
3/20/2012 CS04 804B Image Processing - Module2 66
1 1
( 1, 1) ( 1, 1) ( 1, 0) ( 1, ) ...
(0, 0) ( , ) ...
(1, 0) ( 1, ) (1,1) ( 1, 1)
s t
w f x y w f x y
w f x y
w f x y w f x y
=− =−
= − − − − + − − +
+ +
+ + + + +
∑ ∑
Simplified as
1 1 2 2
1
...
mn mn
mn
i i
i
R w z w z w z
w z
=
= + + +
=

3/20/2012 CS04 804B Image Processing - Module2 67
1
1 1 2 2 9 9
...
mn
i i
i
R w z
w z w z w z
=
=
= + + +

3/20/2012 CS04 804B Image Processing - Module2 68
Spatial filtering - Special processing for border pixels
Replication of rows or columns. Replication of rows or columns.
3/20/2012 CS04 804B Image Processing - Module2 69
Non-Linear Spatial Filtering
Filtering operation is based conditionally on the values of
pixels in the neighborhood.
eg; computing median eg; computing median
3/20/2012 CS04 804B Image Processing - Module2 70
Linear Spatial Filtering
Non-Linear Spatial Filtering
Smoothing Spatial Filters
Smoothing Linear Filters
Box-Filter
Weighted Average Filter
Order-Statistics Filters (Non-Linear Spatial Filters)
Median Filter Median Filter
Max-filter
Min-filter
Sharpening Spatial Filters
Second-Order Derivatives
Laplacian
High Boost Filtering and its Application
3/20/2012 CS04 804B Image Processing - Module2 71
Smoothing Spatial Filters
Smoothing Linear Spatial Filters
Used for blurring and noise reduction.
Called averaging filters or lowpass filters – Output is the Called averaging filters or lowpass filters – Output is the
average of pixels contained in the neighborhood of filter mask.
Replaces every pixel in an image by the average of gray levels
in the neighborhood defined by filter mask.
Side-effect – blurring of edges and smoothing of false
contours.
3/20/2012 CS04 804B Image Processing - Module2 72
Box Filter
Spatial averaging filter in which all coefficients are equal.
Standard average of pixels under the mask.
1
1
mn
i
i
R z
mn
=
=

Weighted Average Filter
Pixels are multiplied by different filter coefficients, giving
more weight to some pixels.
3/20/2012 CS04 804B Image Processing - Module2 73
1 i
mn
=
Filtering using Weighted Average Filter is given by
( , ) ( , )
( , )
( , )
a b
s a t b
a b
w s t f x s y t
g x y
w s t
=− =−
+ +
=
∑ ∑
∑ ∑
3/20/2012 CS04 804B Image Processing - Module2 74
( , )
1 1
, , .
2 2
0,1,..., 1 0,1,..., 1.
s a t b
w s t
m n
where a b mand nareodd
x M and y N
=− =−
− −
= =
= − = −
∑ ∑
3/20/2012 CS04 804B Image Processing - Module2 75
Linear Spatial Filtering
Non-Linear Spatial Filtering
Smoothing Spatial Filters
Smoothing Linear Filters
Box-Filter
Weighted Average Filter
Order-Statistics Filters (Non-Linear Spatial Filters)
Median Filter Median Filter
Max-filter
Min-filter
Sharpening Spatial Filters
Second-Order Derivatives
Laplacian
High Boost Filtering and its Application
3/20/2012 CS04 804B Image Processing - Module2 76
Order-Statistics Filters
Response is based on ordering the pixels and then
repalcing the central pixel value with the value determined
by the ranking result.
Median Filter Median Filter
Sorts pixel values and computes median .
Replaces value of the pixel with median of gray levels in the
neighborhood.
Excellent noise reduction; less blurring.
Effective in the presence of salt and pepper noise.
3/20/2012 CS04 804B Image Processing - Module2 77
Max Filter
R = max{z
k
| k=1,2,…mn}.
Used to find the brightest points in an image.
Min Filter Min Filter
R = min{z
k
| k=1,2,…mn}.
Used to find the darkest points in an image.
3/20/2012 CS04 804B Image Processing - Module2 78
Linear Spatial Filtering
Non-Linear Spatial Filtering
Smoothing Spatial Filters
Smoothing Linear Filters
Box-Filter
Weighted Average Filter
Order-Statistics Filters (Non-Linear Spatial Filters)
Median Filter Median Filter
Max-filter
Min-filter
Sharpening Spatial Filters
Second-Order Derivatives
Laplacian
High Boost Filtering and its Application
3/20/2012 CS04 804B Image Processing - Module2 79
Sharpening Spatial Filters
Used to highlight the fine detail in an image.
To enhance the detail that has been blurred.
To enhance edges, noise etc.
Sharpening is done through spatial differentiation. Sharpening is done through spatial differentiation.
Based on first derivatives
Based on second derivatives
3/20/2012 CS04 804B Image Processing - Module2 80
( 1) ( )
f
f x f x
x

= + −

2
2
( 1) ( 1) 2 ( )
f
f x f x f x
x

= + + − −

First order derivatives
Must be zero in flat segments.
Must be non-zero at the onset of a gray-level step or ramp.
Must be non-zero along ramps.
Second order derivatives Second order derivatives
Must be zero in flat areas.
Must be non-zero at the onset and end of a gray-level step or
ramp.
Must be zero along ramps of constant slope.
3/20/2012 CS04 804B Image Processing - Module2 81
Based on first derivatives
Produces thicker edges
Stronger response to gray-level step.
Based on second derivatives
Stronger response to finer detail Stronger response to finer detail
Produces double response at step changes.
So second-order derivatives are more suited than first-order
derivatives for enhancing fine details.
3/20/2012 CS04 804B Image Processing - Module2 82
3/20/2012 CS04 804B Image Processing - Module2 83
Use of Second Derivatives
Laplacian - Laplacian for f(x,y)
2 2
2
2 2
2
( 1, ) ( 1, ) 2 ( , )
f f
f
x y
f
f x y f x y f x y
∂ ∂
∇ = +
∂ ∂

= + + − −
3/20/2012 CS04 804B Image Processing - Module2 84
2
2
2
2
( 1, ) ( 1, ) 2 ( , )
( , 1) ( , 1) 2 ( , )
( 1, ) ( 1, )
( , 1) ( , 1) 4 ( , )
f x y f x y f x y
x
f
f x y f x y f x y
y
f f x y f x y
f x y f x y f x y
= + + − −

= + + − −

∴∇ = + + − +
+ + − −
Highlights gray-level discontinuities
2
( , ) ( , )
( , )
if thecentrecoefficient of the
f x y f x y
g x y
if thecentrecoefficient of the
¦
−∇
¦
¦
=
´
¦
3/20/2012 CS04 804B Image Processing - Module2 85
2
( , )
( , ) ( , )
g x y
if thecentrecoefficient of the
f x y f x y
=
´
¦
+∇
¦
¹
Subtracts blurred version of the image from the original
image.
( , ) ( , ) ( , )
s
f x y f x y f x y = −
Used in dark-room photography.
3/20/2012 CS04 804B Image Processing - Module2 86
High Boost Filtering
( , )
( , ) ( , ) ( , )
( 1) ( , ) ( , ) ( , )
( 1) ( , ) ( , )
s
hb
f x y
s
f x y Af x y f x y
A f x y f x y f x y
A f x y f x y
= −
= − + −
= − +
1442443
3/20/2012 CS04 804B Image Processing - Module2 87
( 1) ( , ) ( , )
s
A f x y f x y = − +
2
2
( , ) ( , )
( , ) ( , )
hb
if thecentrecoefficient of the
Af x y f x y
f
if thecentrecoefficient of the
Af x y f x y
¦
−∇
¦
¦
=
´
¦
+∇
¦
¹
When A = 1, high-boost filtering becomes standard
Laplacian sharpening.
Application:
To make images lighter.
3/20/2012 CS04 804B Image Processing - Module2 88
Use of First Derivatives
,
f
x
f
y

(
(

( ∇ =

(
(

¸ ¸
First order derivatives of a digital image are based on
various approximations of the 2D gradient.
1
2
2
2
y
f f
Magnitudeof f
x y
(

¸ ¸
(
| | ∂ ∂
| |
∇ = + (
| |
∂ ∂
\ ¹
( \ ¹
¸ ¸
3/20/2012 89 CS04 804B Image Processing - Module2
The mathematical implementation of first order
derivatives can be done by masks known as
Prewitt operator
Sobel operator
• Let the 3 3 area represent the gray levels in a neighborhood of an image, • Let the 3 3 area represent the gray levels in a neighborhood of an image,
as shown below
3/20/2012 90 CS04 804B Image Processing - Module2
Equations
( )
( )
9 5
8 6
x
y
G z z
G z z
= −
= −
3/20/2012 91 CS04 804B Image Processing - Module2
Prewitt operator
Equations
( ) ( )
( ) ( )
7 8 9 1 2 3
3 6 9 1 4 7
x
y
G z z z z z z
G z z z z z z
= + + − + +
= + + − + +
3/20/2012 92 CS04 804B Image Processing - Module2
Sobel operator
Equations
( ) ( )
( ) ( )
7 8 9 1 2 3
3 6 9 1 4 7
2 2
2 2
x
y
G z z z z z z
G z z z z z z
= + + − + +
= + + − + +