SlideShare a Scribd company logo
1 of 97
Lecture 2. Intensity Transformation
and Spatial Filtering
4/3/2023 2
Spatial Domain vs. Transform Domain
► Spatial domain
image plane itself, directly process the intensity values of
the image plane
► Transform domain
process the transform coefficients, not directly process the
intensity values of the image plane
4/3/2023 3
Spatial Domain Process
( , ) [ ( , )])
( , ) :input image
( , ) :output image
:an operator on defined over
a neighborhood of point ( , )
g x y T f x y
f x y
g x y
T f
x y

4/3/2023 4
Spatial Domain Process
4/3/2023 5
Spatial Domain Process
Intensity transformation function
( )
s T r

4/3/2023 6
Some Basic Intensity Transformation
Functions
4/3/2023 7
Image Negatives
Image negatives
1
s L r
  
4/3/2023 8
Example: Image Negatives
Small
lesion
4/3/2023 9
Log Transformations
Log Transformations
log(1 )
s c r
 
4/3/2023 10
Example: Log Transformations
4/3/2023 11
Power-Law (Gamma) Transformations
s cr

4/3/2023 12
Example: Gamma Transformations
4/3/2023 13
Example: Gamma Transformations
Cathode ray tube
(CRT) devices have an
intensity-to-voltage
response that is a
power function, with
exponents varying
from approximately
1.8 to 2.5
1/2.5
s r

4/3/2023 14
Example: Gamma Transformations
4/3/2023 15
Example: Gamma Transformations
4/3/2023 16
Piecewise-Linear Transformations
► Contrast Stretching
— Expands the range of intensity levels in an image so that it spans
the full intensity range of the recording medium or display device.
► Intensity-level Slicing
— Highlighting a specific range of intensities in an image often is of
interest.
4/3/2023 17
4/3/2023 18
Highlight the major
blood vessels and
study the shape of the
flow of the contrast
medium (to detect
blockages, etc.)
Measuring the actual
flow of the contrast
medium as a function
of time in a series of
images
4/3/2023 19
Bit-plane Slicing
4/3/2023 20
Bit-plane Slicing
4/3/2023 21
Bit-plane Slicing
4/3/2023 22
Histogram Processing
► Histogram Equalization
► Histogram Matching
► Local Histogram Processing
► Using Histogram Statistics for Image Enhancement
4/3/2023 23
Histogram Processing
Histogram ( )
is the intensity value
is the number of pixels in the image with intensity
k k
th
k
k k
h r n
r k
n r

Normalized histogram ( )
: the number of pixels in the image of
size M N with intensity
k
k
k
k
n
p r
MN
n
r


4/3/2023 24
4/3/2023 25
Histogram Equalization
The intensity levels in an image may be viewed as
random variables in the interval [0, L-1].
Let ( ) and ( ) denote the probability density
function (PDF) of random variables and .
r s
p r p s
r s
4/3/2023 26
Histogram Equalization
( ) 0 1
s T r r L
   
. T(r) is a strictly monotonically increasing function
in the interval 0 -1;
. 0 ( ) -1 for 0 -1.
a
r L
b T r L r L
 
   
4/3/2023 27
Histogram Equalization
. T(r) is a strictly monotonically increasing function
in the interval 0 -1;
. 0 ( ) -1 for 0 -1.
a
r L
b T r L r L
 
   
( ) 0 1
s T r r L
   
( ) is continuous and differentiable.
T r
( ) ( )
s r
p s ds p r dr

4/3/2023 28
Histogram Equalization
0
( ) ( 1) ( )
r
r
s T r L p w dw
   
0
( )
( 1) ( )
r
r
ds dT r d
L p w dw
dr dr dr
 
  
 
 

( 1) ( )
r
L p r
 
 
( ) 1
( ) ( )
( )
( 1) ( ) 1
r r r
s
r
p r dr p r p r
p s
L p r
ds
ds L
dr
   

  
 
 
4/3/2023 29
Example
2
Suppose that the (continuous) intensity values
in an image have the PDF
2
, for 0 r L-1
( 1)
( )
0, otherwise
Find the transformation function for equalizing
the image histogra
r
r
L
p r

 


 


m.
4/3/2023 30
Example
0
( ) ( 1) ( )
r
r
s T r L p w dw
   
2
0
2
( 1)
( 1)
r w
L dw
L
 


2
1
r
L


4/3/2023 31
Histogram Equalization
0
Continuous case:
( ) ( 1) ( )
r
r
s T r L p w dw
   
0
Discrete values:
( ) ( 1) ( )
k
k k r j
j
s T r L p r

   
0 0
1
( 1) k=0,1,..., L-1
k k
j
j
j j
n L
L n
MN MN
 

  
 
4/3/2023 32
Example: Histogram Equalization
Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096)
has the intensity distribution shown in following table.
Get the histogram equalization transformation function and give the
ps(sk) for each sk.
4/3/2023 33
Example: Histogram Equalization
0
0 0
0
( ) 7 ( ) 7 0.19 1.33
r j
j
s T r p r

    
 1

1
1 1
0
( ) 7 ( ) 7 (0.19 0.25) 3.08
r j
j
s T r p r

     
 3

2 3
4 5
6 7
4.55 5 5.67 6
6.23 6 6.65 7
6.86 7 7.00 7
s s
s s
s s
   
   
   
4/3/2023 34
Example: Histogram Equalization
4/3/2023 35
4/3/2023 36
Figure 3.22
(a) Image from Phoenix Lander. (b) Result of histogram
equalization. (c) Histogram of image (a). (d) Histogram of image
(b). (Original image courtesy of NASA.)
4/3/2023 38
Question
Is histogram equalization always good?
No
4/3/2023 39
Histogram Matching
Histogram matching (histogram specification)
— generate a processed image that has a specified histogram
Let ( ) and ( ) denote the continous probability
density functions of the variables and . ( ) is the
specified probability density function.
Let be the random variable with the prob
r z
z
p r p z
r z p z
s
0
0
ability
( ) ( 1) ( )
Define a random variable with the probability
( ) ( 1) ( )
r
r
z
z
s T r L p w dw
z
G z L p t dt s
  
  


4/3/2023 40
Histogram Matching
0
0
( ) ( 1) ( )
( ) ( 1) ( )
r
r
z
z
s T r L p w dw
G z L p t dt s
  
  


 
1 1
( ) ( )
z G s G T r
 
 
4/3/2023 41
Histogram Matching: Procedure
► Obtain pr(r) from the input image and then obtain the values of s
► Use the specified PDF and obtain the transformation function G(z)
► Mapping from s to z
0
( 1) ( )
r
r
s L p w dw
  
0
( ) ( 1) ( )
z
z
G z L p t dt s
  

1
( )
z G s


4/3/2023 42
Histogram Matching: Example
Assuming continuous intensity values, suppose that an image has
the intensity PDF
Find the transformation function that will produce an image
whose intensity PDF is
2
2
, for 0 -1
( 1)
( )
0 , otherwise
r
r
r L
L
p r

 


 


2
3
3
, for 0 ( -1)
( ) ( 1)
0, otherwise
z
z
z L
p z L

 

 



4/3/2023 43
Histogram Matching: Example
Find the histogram equalization transformation for the input image
Find the histogram equalization transformation for the specified histogram
The transformation function
2
0 0
2
( ) ( 1) ( ) ( 1)
( 1)
r r
r
w
s T r L p w dw L dw
L
    

 
2 3
3 2
0 0
3
( ) ( 1) ( ) ( 1)
( 1) ( 1)
z z
z
t z
G z L p t dt L dt s
L L
     
 
 
2
1
r
L


1/3
2
1/3 1/3
2 2 2
( 1) ( 1) ( 1)
1
r
z L s L L r
L
 
   
     
 
   

 
4/3/2023 44
Histogram Matching: Discrete Cases
► Obtain pr(rj) from the input image and then obtain the values of
sk, round the value to the integer range [0, L-1].
► Use the specified PDF and obtain the transformation function
G(zq), round the value to the integer range [0, L-1].
► Mapping from sk to zq
0 0
( 1)
( ) ( 1) ( )
k k
k k r j j
j j
L
s T r L p r n
MN
 

   
 
0
( ) ( 1) ( )
q
q z i k
i
G z L p z s

  

1
( )
q k
z G s


4/3/2023 45
Example: Histogram Matching
Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096)
has the intensity distribution shown in the following table (on the
left). Get the histogram transformation function and make the output
image with the specified histogram, listed in the table on the right.
4/3/2023 46
Example: Histogram Matching
Obtain the scaled histogram-equalized values,
Compute all the values of the transformation function G,
0 1 2 3 4
5 6 7
1, 3, 5, 6, 7,
7, 7, 7.
s s s s s
s s s
    
  
0
0
0
( ) 7 ( ) 0.00
z j
j
G z p z

 

1 2
3 4
5 6
7
( ) 0.00 ( ) 0.00
( ) 1.05 ( ) 2.45
( ) 4.55 ( ) 5.95
( ) 7.00
G z G z
G z G z
G z G z
G z
 
 
 

0

0
 0

1
 2

6

5

7

4/3/2023 47
Example: Histogram Matching
4/3/2023 48
Example: Histogram Matching
Obtain the scaled histogram-equalized values,
Compute all the values of the transformation function G,
0 1 2 3 4
5 6 7
1, 3, 5, 6, 7,
7, 7, 7.
s s s s s
s s s
    
  
0
0
0
( ) 7 ( ) 0.00
z j
j
G z p z

 

1 2
3 4
5 6
7
( ) 0.00 ( ) 0.00
( ) 1.05 ( ) 2.45
( ) 4.55 ( ) 5.95
( ) 7.00
G z G z
G z G z
G z G z
G z
 
 
 

0

0
 0

1
 2

6

5

7

s0
s2 s3
s5 s6 s7
s1
s4
4/3/2023 49
Example: Histogram Matching
0 1 2 3 4
5 6 7
1, 3, 5, 6, 7,
7, 7, 7.
s s s s s
s s s
    
  
0
1
2
3
4
5
6
7
k
r
4/3/2023 50
Example: Histogram Matching
0 3
1 4
2 5
3 6
4 7
5 7
6 7
7 7
k q
r z









4/3/2023 51
Example: Histogram Matching
4/3/2023 52
Example: Histogram Matching
4/3/2023 53
Example: Histogram Matching
4/3/2023 54
Example: Histogram Matching
Figure 3.24
(a) An image, and (b) its histogram.
Figure 3.25
(a) Histogram equalization transformation obtained using the histogram
in Fig. 3.24(b). (b) Histogram equalized image. (c) Histogram of
equalized image.
Figure 3.26
Histogram specification. (a) Specified histogram. (b) Transformation  
q
G z ,
labeled (1),
and
 
1
k
G s ,

labeled (2). (c) Result of histogram specification. (d)
Histogram of image (c).
4/3/2023 58
Local Histogram Processing
Define a neighborhood and move its center from pixel to
pixel
At each location, the histogram of the points in the
neighborhood is computed. Either histogram equalization or
histogram specification transformation function is obtained
Map the intensity of the pixel centered in the neighborhood
Move to the next location and repeat the procedure
4/3/2023 59
Local Histogram Processing: Example
Figure 3.33
(a) Original image. (b) Result of local enhancement based
on local histogram statistics. Compare (b) with Fig. 3.32(c).
4/3/2023 61
Using Histogram Statistics for Image
Enhancement
1
0
( )
L
i i
i
m r p r


 
1
0
( ) ( ) ( )
L
n
n i i
i
u r r m p r


 

1
2 2
2
0
( ) ( ) ( )
L
i i
i
u r r m p r



  

1 1
0 0
1
( , )
M N
x y
f x y
MN
 
 
 
 
1 1
2
0 0
1
( , )
M N
x y
f x y m
MN
 
 
 

Average Intensity
Variance
4/3/2023 62
Using Histogram Statistics for Image
Enhancement
1
0
Local average intensity
( )
denotes a neighborhood
xy xy
L
s i s i
i
xy
m r p r
s


 
1
2 2
0
Local variance
( ) ( )
xy xy xy
L
s i s s i
i
r m p r



 

4/3/2023 63
Using Histogram Statistics for Image
Enhancement: Example
0 1 2
0 1 2
( , ), if and
( , )
( , ), otherwise
:global mean; :global standard deviation
0.4; 0.02; 0.4; 4
xy xy
s G G s G
G G
E f x y m k m k k
g x y
f x y
m
k k k E
  

  


 


   
4/3/2023 64
Spatial Filtering
A spatial filter consists of (a) a neighborhood, and (b) a
predefined operation
Linear spatial filtering of an image of size MxN with a filter
of size mxn is given by the expression
( , ) ( , ) ( , )
a b
s a t b
g x y w s t f x s y t
 
  
 
4/3/2023 65
Spatial Filtering
4/3/2023 66
Spatial Correlation
The correlation of a filter ( , ) of size
with an image ( , ), denoted as ( , ) ( , )
w x y m n
f x y w x y f x y

( , ) ( , ) ( , ) ( , )
a b
s a t b
w x y f x y w s t f x s y t
 
  
 
4/3/2023 67
Spatial Convolution
The convolution of a filter ( , ) of size
with an image ( , ), denoted as ( , ) ( , )
w x y m n
f x y w x y f x y

( , ) ( , ) ( , ) ( , )
a b
s a t b
w x y f x y w s t f x s y t
 
  
 
Figure 3.35
Illustration of 1-D correlation and convolution of a kernel, w, with a function f consisting
of a discrete unit impulse. Note that correlation and convolution are functions of the
variable x, which acts to displace one function with respect to the other. For the
extended correlation and convolution results, the starting configuration places the
rightmost element of the kernel to be coincident with the origin of f. Additional padding
must be used.
4/3/2023 69
Figure 3.58
Transfer functions of ideal 1-D filters in the frequency
domain (u denotes frequency). (a) Lowpass filter. (b)
Highpass filter. (c) Bandreject filter. (d) Bandpass filter. (As
before, we show only positive frequencies for simplicity.)
Table 3.7
Summary of the four principal spatial filter types expressed
in terms of lowpass filters. The centers of the unit impulse
and the filter kernels coincide.
4/3/2023 72
Smoothing Spatial Filters
Smoothing filters are used for blurring and for noise
reduction
Blurring is used in removal of small details and bridging of
small gaps in lines or curves
Smoothing spatial filters include linear filters and nonlinear
filters.
4/3/2023 73
Spatial Smoothing Linear Filters
The general implementation for filtering an M N image
with a weighted averaging filter of size m n is given
( , ) ( , )
( , )
( , )
where 2 1
a b
s a t b
a b
s a t b
w s t f x s y t
g x y
w s t
m a
 
 


 

 
 
 
, 2 1.
n b
 
4/3/2023 74
Two Smoothing Averaging Filter Masks
4/3/2023 75
4/3/2023 76
Example: Gross Representation of Objects
4/3/2023 77
Order-statistic (Nonlinear) Filters
— Nonlinear
— Based on ordering (ranking) the pixels contained in the
filter mask
— Replacing the value of the center pixel with the value
determined by the ranking result
E.g., median filter, max filter, min filter
4/3/2023 78
Example: Use of Median Filtering for Noise Reduction
4/3/2023 79
Sharpening Spatial Filters
► Foundation
► Laplacian Operator
► Unsharp Masking and Highboost Filtering
► Using First-Order Derivatives for Nonlinear Image
Sharpening — The Gradient
4/3/2023 80
Sharpening Spatial Filters: Foundation
► The first-order derivative of a one-dimensional function f(x)
is the difference
► The second-order derivative of f(x) as the difference
( 1) ( )
f
f x f x
x

  

2
2
( 1) ( 1) 2 ( )
f
f x f x f x
x

    

4/3/2023 81
4/3/2023 82
Sharpening Spatial Filters: Laplace Operator
The second-order isotropic derivative operator is the
Laplacian for a function (image) f(x,y)
2 2
2
2 2
f f
f
x y
 
  
 
2
2
( 1, ) ( 1, ) 2 ( , )
f
f x y f x y f x y
x

    

2
2
( , 1) ( , 1) 2 ( , )
f
f x y f x y f x y
y

    

2
( 1, ) ( 1, ) ( , 1) ( , 1)
-4 ( , )
f f x y f x y f x y f x y
f x y
        
4/3/2023 83
Sharpening Spatial Filters: Laplace Operator
4/3/2023 84
Sharpening Spatial Filters: Laplace Operator
Image sharpening in the way of using the Laplacian:
2
2
( , ) ( , ) ( , )
where,
( , ) is input image,
( , ) is sharpenend images,
-1 if ( , ) corresponding to Fig. 3.37(a) or (b)
and 1 if either of the other two filters is us
g x y f x y c f x y
f x y
g x y
c f x y
c
 
  
 
 
 ed.
4/3/2023 85
4/3/2023 86
Unsharp Masking and Highboost Filtering
► Unsharp masking
Sharpen images consists of subtracting an unsharp (smoothed)
version of an image from the original image
e.g., printing and publishing industry
► Steps
1. Blur the original image
2. Subtract the blurred image from the original
3. Add the mask to the original
4/3/2023 87
Unsharp Masking and Highboost Filtering
Let ( , ) denote the blurred image, unsharp masking is
( , ) ( , ) ( , )
Then add a weighted portion of the mask back to the original
( , ) ( , ) * ( , )
mask
mask
f x y
g x y f x y f x y
g x y f x y k g x y
 
  0
k 
when 1, the process is referred to as highboost filtering.
k 
4/3/2023 88
Unsharp Masking: Demo
Figure 3.55
(a) Unretouched “soft-tone” digital image of size
469×600pixels
(b) Image blurred using
a
31×31 Gaussian lowpass filter with σ =
5.
(c) Mask. (d) Result of unsharp masking using Eq. (3-65) with k = 1.
(e) and (f) Results of highboost filtering with k = 2 and k = 3,
respectively.
4/3/2023 90
Unsharp Masking and Highboost Filtering: Example
4/3/2023 91
Image Sharpening based on First-Order Derivatives
For function ( , ), the gradient of at coordinates ( , )
is defined as
grad( )
x
y
f x y f x y
f
g x
f f
f
g
y

 
 
  
 
   
  
 
 
 

 
2 2
The of vector , denoted as ( , )
( , ) mag( ) x y
magnitude f M x y
M x y f g g

   
Gradient Image
4/3/2023 92
Image Sharpening based on First-Order Derivatives
2 2
The of vector , denoted as ( , )
( , ) mag( ) x y
magnitude f M x y
M x y f g g

   
( , ) | | | |
x y
M x y g g
 
z1 z2 z3
z4 z5 z6
z7 z8 z9
8 5 6 5
( , ) | | | |
M x y z z z z
   
4/3/2023 93
Image Sharpening based on First-Order Derivatives
z1 z2 z3
z4 z5 z6
z7 z8 z9
9 5 8 6
Roberts Cross-gradient Operators
( , ) | | | |
M x y z z z z
   
7 8 9 1 2 3
3 6 9 1 4 7
Sobel Operators
( , ) | ( 2 ) ( 2 ) |
| ( 2 ) ( 2 ) |
M x y z z z z z z
z z z z z z
     
     
4/3/2023 94
Image Sharpening based on First-Order Derivatives
4/3/2023 95
Example
4/3/2023 96
Example:
Combining
Spatial
Enhancement
Methods
Goal:
Enhance the
image by
sharpening it
and by bringing
out more of the
skeletal detail
4/3/2023 97
Example:
Combining
Spatial
Enhancement
Methods
Goal:
Enhance the
image by
sharpening it
and by bringing
out more of the
skeletal detail

More Related Content

Similar to annotated-chap-3-gw.ppt

3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdfnatnaeltamirat6212
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureFatmaNewagy1
 
Digital image processing using matlab: basic transformations, filters and ope...
Digital image processing using matlab: basic transformations, filters and ope...Digital image processing using matlab: basic transformations, filters and ope...
Digital image processing using matlab: basic transformations, filters and ope...thanh nguyen
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.pptSKILL2021
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portionMoe Moe Myint
 
Histogram based Enhancement
Histogram based Enhancement Histogram based Enhancement
Histogram based Enhancement Vivek V
 
Histogram based enhancement
Histogram based enhancementHistogram based enhancement
Histogram based enhancementliba manopriya.J
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
 
Digital signal and image processing FAQ
Digital signal and image processing FAQDigital signal and image processing FAQ
Digital signal and image processing FAQMukesh Tekwani
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and RepresentationAmnaakhaan
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformationalobaidimki
 

Similar to annotated-chap-3-gw.ppt (20)

3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lecture
 
Digital image processing using matlab: basic transformations, filters and ope...
Digital image processing using matlab: basic transformations, filters and ope...Digital image processing using matlab: basic transformations, filters and ope...
Digital image processing using matlab: basic transformations, filters and ope...
 
chap3.ppt
chap3.pptchap3.ppt
chap3.ppt
 
Dip3
Dip3Dip3
Dip3
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
N045077984
N045077984N045077984
N045077984
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
 
Histogram based Enhancement
Histogram based Enhancement Histogram based Enhancement
Histogram based Enhancement
 
Histogram based enhancement
Histogram based enhancementHistogram based enhancement
Histogram based enhancement
 
Lecture 5.pptx
Lecture 5.pptxLecture 5.pptx
Lecture 5.pptx
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
Digital signal and image processing FAQ
Digital signal and image processing FAQDigital signal and image processing FAQ
Digital signal and image processing FAQ
 
matlab.docx
matlab.docxmatlab.docx
matlab.docx
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformation
 

Recently uploaded

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 

Recently uploaded (20)

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 

annotated-chap-3-gw.ppt

  • 1. Lecture 2. Intensity Transformation and Spatial Filtering
  • 2. 4/3/2023 2 Spatial Domain vs. Transform Domain ► Spatial domain image plane itself, directly process the intensity values of the image plane ► Transform domain process the transform coefficients, not directly process the intensity values of the image plane
  • 3. 4/3/2023 3 Spatial Domain Process ( , ) [ ( , )]) ( , ) :input image ( , ) :output image :an operator on defined over a neighborhood of point ( , ) g x y T f x y f x y g x y T f x y 
  • 5. 4/3/2023 5 Spatial Domain Process Intensity transformation function ( ) s T r 
  • 6. 4/3/2023 6 Some Basic Intensity Transformation Functions
  • 7. 4/3/2023 7 Image Negatives Image negatives 1 s L r   
  • 8. 4/3/2023 8 Example: Image Negatives Small lesion
  • 9. 4/3/2023 9 Log Transformations Log Transformations log(1 ) s c r  
  • 10. 4/3/2023 10 Example: Log Transformations
  • 11. 4/3/2023 11 Power-Law (Gamma) Transformations s cr 
  • 12. 4/3/2023 12 Example: Gamma Transformations
  • 13. 4/3/2023 13 Example: Gamma Transformations Cathode ray tube (CRT) devices have an intensity-to-voltage response that is a power function, with exponents varying from approximately 1.8 to 2.5 1/2.5 s r 
  • 14. 4/3/2023 14 Example: Gamma Transformations
  • 15. 4/3/2023 15 Example: Gamma Transformations
  • 16. 4/3/2023 16 Piecewise-Linear Transformations ► Contrast Stretching — Expands the range of intensity levels in an image so that it spans the full intensity range of the recording medium or display device. ► Intensity-level Slicing — Highlighting a specific range of intensities in an image often is of interest.
  • 18. 4/3/2023 18 Highlight the major blood vessels and study the shape of the flow of the contrast medium (to detect blockages, etc.) Measuring the actual flow of the contrast medium as a function of time in a series of images
  • 22. 4/3/2023 22 Histogram Processing ► Histogram Equalization ► Histogram Matching ► Local Histogram Processing ► Using Histogram Statistics for Image Enhancement
  • 23. 4/3/2023 23 Histogram Processing Histogram ( ) is the intensity value is the number of pixels in the image with intensity k k th k k k h r n r k n r  Normalized histogram ( ) : the number of pixels in the image of size M N with intensity k k k k n p r MN n r  
  • 25. 4/3/2023 25 Histogram Equalization The intensity levels in an image may be viewed as random variables in the interval [0, L-1]. Let ( ) and ( ) denote the probability density function (PDF) of random variables and . r s p r p s r s
  • 26. 4/3/2023 26 Histogram Equalization ( ) 0 1 s T r r L     . T(r) is a strictly monotonically increasing function in the interval 0 -1; . 0 ( ) -1 for 0 -1. a r L b T r L r L      
  • 27. 4/3/2023 27 Histogram Equalization . T(r) is a strictly monotonically increasing function in the interval 0 -1; . 0 ( ) -1 for 0 -1. a r L b T r L r L       ( ) 0 1 s T r r L     ( ) is continuous and differentiable. T r ( ) ( ) s r p s ds p r dr 
  • 28. 4/3/2023 28 Histogram Equalization 0 ( ) ( 1) ( ) r r s T r L p w dw     0 ( ) ( 1) ( ) r r ds dT r d L p w dw dr dr dr           ( 1) ( ) r L p r     ( ) 1 ( ) ( ) ( ) ( 1) ( ) 1 r r r s r p r dr p r p r p s L p r ds ds L dr            
  • 29. 4/3/2023 29 Example 2 Suppose that the (continuous) intensity values in an image have the PDF 2 , for 0 r L-1 ( 1) ( ) 0, otherwise Find the transformation function for equalizing the image histogra r r L p r          m.
  • 30. 4/3/2023 30 Example 0 ( ) ( 1) ( ) r r s T r L p w dw     2 0 2 ( 1) ( 1) r w L dw L     2 1 r L  
  • 31. 4/3/2023 31 Histogram Equalization 0 Continuous case: ( ) ( 1) ( ) r r s T r L p w dw     0 Discrete values: ( ) ( 1) ( ) k k k r j j s T r L p r      0 0 1 ( 1) k=0,1,..., L-1 k k j j j j n L L n MN MN        
  • 32. 4/3/2023 32 Example: Histogram Equalization Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the intensity distribution shown in following table. Get the histogram equalization transformation function and give the ps(sk) for each sk.
  • 33. 4/3/2023 33 Example: Histogram Equalization 0 0 0 0 ( ) 7 ( ) 7 0.19 1.33 r j j s T r p r        1  1 1 1 0 ( ) 7 ( ) 7 (0.19 0.25) 3.08 r j j s T r p r         3  2 3 4 5 6 7 4.55 5 5.67 6 6.23 6 6.65 7 6.86 7 7.00 7 s s s s s s            
  • 37. Figure 3.22 (a) Image from Phoenix Lander. (b) Result of histogram equalization. (c) Histogram of image (a). (d) Histogram of image (b). (Original image courtesy of NASA.)
  • 38. 4/3/2023 38 Question Is histogram equalization always good? No
  • 39. 4/3/2023 39 Histogram Matching Histogram matching (histogram specification) — generate a processed image that has a specified histogram Let ( ) and ( ) denote the continous probability density functions of the variables and . ( ) is the specified probability density function. Let be the random variable with the prob r z z p r p z r z p z s 0 0 ability ( ) ( 1) ( ) Define a random variable with the probability ( ) ( 1) ( ) r r z z s T r L p w dw z G z L p t dt s        
  • 40. 4/3/2023 40 Histogram Matching 0 0 ( ) ( 1) ( ) ( ) ( 1) ( ) r r z z s T r L p w dw G z L p t dt s           1 1 ( ) ( ) z G s G T r    
  • 41. 4/3/2023 41 Histogram Matching: Procedure ► Obtain pr(r) from the input image and then obtain the values of s ► Use the specified PDF and obtain the transformation function G(z) ► Mapping from s to z 0 ( 1) ( ) r r s L p w dw    0 ( ) ( 1) ( ) z z G z L p t dt s     1 ( ) z G s  
  • 42. 4/3/2023 42 Histogram Matching: Example Assuming continuous intensity values, suppose that an image has the intensity PDF Find the transformation function that will produce an image whose intensity PDF is 2 2 , for 0 -1 ( 1) ( ) 0 , otherwise r r r L L p r          2 3 3 , for 0 ( -1) ( ) ( 1) 0, otherwise z z z L p z L         
  • 43. 4/3/2023 43 Histogram Matching: Example Find the histogram equalization transformation for the input image Find the histogram equalization transformation for the specified histogram The transformation function 2 0 0 2 ( ) ( 1) ( ) ( 1) ( 1) r r r w s T r L p w dw L dw L         2 3 3 2 0 0 3 ( ) ( 1) ( ) ( 1) ( 1) ( 1) z z z t z G z L p t dt L dt s L L           2 1 r L   1/3 2 1/3 1/3 2 2 2 ( 1) ( 1) ( 1) 1 r z L s L L r L                     
  • 44. 4/3/2023 44 Histogram Matching: Discrete Cases ► Obtain pr(rj) from the input image and then obtain the values of sk, round the value to the integer range [0, L-1]. ► Use the specified PDF and obtain the transformation function G(zq), round the value to the integer range [0, L-1]. ► Mapping from sk to zq 0 0 ( 1) ( ) ( 1) ( ) k k k k r j j j j L s T r L p r n MN          0 ( ) ( 1) ( ) q q z i k i G z L p z s      1 ( ) q k z G s  
  • 45. 4/3/2023 45 Example: Histogram Matching Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the intensity distribution shown in the following table (on the left). Get the histogram transformation function and make the output image with the specified histogram, listed in the table on the right.
  • 46. 4/3/2023 46 Example: Histogram Matching Obtain the scaled histogram-equalized values, Compute all the values of the transformation function G, 0 1 2 3 4 5 6 7 1, 3, 5, 6, 7, 7, 7, 7. s s s s s s s s         0 0 0 ( ) 7 ( ) 0.00 z j j G z p z     1 2 3 4 5 6 7 ( ) 0.00 ( ) 0.00 ( ) 1.05 ( ) 2.45 ( ) 4.55 ( ) 5.95 ( ) 7.00 G z G z G z G z G z G z G z        0  0  0  1  2  6  5  7 
  • 48. 4/3/2023 48 Example: Histogram Matching Obtain the scaled histogram-equalized values, Compute all the values of the transformation function G, 0 1 2 3 4 5 6 7 1, 3, 5, 6, 7, 7, 7, 7. s s s s s s s s         0 0 0 ( ) 7 ( ) 0.00 z j j G z p z     1 2 3 4 5 6 7 ( ) 0.00 ( ) 0.00 ( ) 1.05 ( ) 2.45 ( ) 4.55 ( ) 5.95 ( ) 7.00 G z G z G z G z G z G z G z        0  0  0  1  2  6  5  7  s0 s2 s3 s5 s6 s7 s1 s4
  • 49. 4/3/2023 49 Example: Histogram Matching 0 1 2 3 4 5 6 7 1, 3, 5, 6, 7, 7, 7, 7. s s s s s s s s         0 1 2 3 4 5 6 7 k r
  • 50. 4/3/2023 50 Example: Histogram Matching 0 3 1 4 2 5 3 6 4 7 5 7 6 7 7 7 k q r z         
  • 55. Figure 3.24 (a) An image, and (b) its histogram.
  • 56. Figure 3.25 (a) Histogram equalization transformation obtained using the histogram in Fig. 3.24(b). (b) Histogram equalized image. (c) Histogram of equalized image.
  • 57. Figure 3.26 Histogram specification. (a) Specified histogram. (b) Transformation   q G z , labeled (1), and   1 k G s ,  labeled (2). (c) Result of histogram specification. (d) Histogram of image (c).
  • 58. 4/3/2023 58 Local Histogram Processing Define a neighborhood and move its center from pixel to pixel At each location, the histogram of the points in the neighborhood is computed. Either histogram equalization or histogram specification transformation function is obtained Map the intensity of the pixel centered in the neighborhood Move to the next location and repeat the procedure
  • 59. 4/3/2023 59 Local Histogram Processing: Example
  • 60. Figure 3.33 (a) Original image. (b) Result of local enhancement based on local histogram statistics. Compare (b) with Fig. 3.32(c).
  • 61. 4/3/2023 61 Using Histogram Statistics for Image Enhancement 1 0 ( ) L i i i m r p r     1 0 ( ) ( ) ( ) L n n i i i u r r m p r      1 2 2 2 0 ( ) ( ) ( ) L i i i u r r m p r        1 1 0 0 1 ( , ) M N x y f x y MN         1 1 2 0 0 1 ( , ) M N x y f x y m MN        Average Intensity Variance
  • 62. 4/3/2023 62 Using Histogram Statistics for Image Enhancement 1 0 Local average intensity ( ) denotes a neighborhood xy xy L s i s i i xy m r p r s     1 2 2 0 Local variance ( ) ( ) xy xy xy L s i s s i i r m p r      
  • 63. 4/3/2023 63 Using Histogram Statistics for Image Enhancement: Example 0 1 2 0 1 2 ( , ), if and ( , ) ( , ), otherwise :global mean; :global standard deviation 0.4; 0.02; 0.4; 4 xy xy s G G s G G G E f x y m k m k k g x y f x y m k k k E                 
  • 64. 4/3/2023 64 Spatial Filtering A spatial filter consists of (a) a neighborhood, and (b) a predefined operation Linear spatial filtering of an image of size MxN with a filter of size mxn is given by the expression ( , ) ( , ) ( , ) a b s a t b g x y w s t f x s y t       
  • 66. 4/3/2023 66 Spatial Correlation The correlation of a filter ( , ) of size with an image ( , ), denoted as ( , ) ( , ) w x y m n f x y w x y f x y  ( , ) ( , ) ( , ) ( , ) a b s a t b w x y f x y w s t f x s y t       
  • 67. 4/3/2023 67 Spatial Convolution The convolution of a filter ( , ) of size with an image ( , ), denoted as ( , ) ( , ) w x y m n f x y w x y f x y  ( , ) ( , ) ( , ) ( , ) a b s a t b w x y f x y w s t f x s y t       
  • 68. Figure 3.35 Illustration of 1-D correlation and convolution of a kernel, w, with a function f consisting of a discrete unit impulse. Note that correlation and convolution are functions of the variable x, which acts to displace one function with respect to the other. For the extended correlation and convolution results, the starting configuration places the rightmost element of the kernel to be coincident with the origin of f. Additional padding must be used.
  • 70. Figure 3.58 Transfer functions of ideal 1-D filters in the frequency domain (u denotes frequency). (a) Lowpass filter. (b) Highpass filter. (c) Bandreject filter. (d) Bandpass filter. (As before, we show only positive frequencies for simplicity.)
  • 71. Table 3.7 Summary of the four principal spatial filter types expressed in terms of lowpass filters. The centers of the unit impulse and the filter kernels coincide.
  • 72. 4/3/2023 72 Smoothing Spatial Filters Smoothing filters are used for blurring and for noise reduction Blurring is used in removal of small details and bridging of small gaps in lines or curves Smoothing spatial filters include linear filters and nonlinear filters.
  • 73. 4/3/2023 73 Spatial Smoothing Linear Filters The general implementation for filtering an M N image with a weighted averaging filter of size m n is given ( , ) ( , ) ( , ) ( , ) where 2 1 a b s a t b a b s a t b w s t f x s y t g x y w s t m a                , 2 1. n b  
  • 74. 4/3/2023 74 Two Smoothing Averaging Filter Masks
  • 76. 4/3/2023 76 Example: Gross Representation of Objects
  • 77. 4/3/2023 77 Order-statistic (Nonlinear) Filters — Nonlinear — Based on ordering (ranking) the pixels contained in the filter mask — Replacing the value of the center pixel with the value determined by the ranking result E.g., median filter, max filter, min filter
  • 78. 4/3/2023 78 Example: Use of Median Filtering for Noise Reduction
  • 79. 4/3/2023 79 Sharpening Spatial Filters ► Foundation ► Laplacian Operator ► Unsharp Masking and Highboost Filtering ► Using First-Order Derivatives for Nonlinear Image Sharpening — The Gradient
  • 80. 4/3/2023 80 Sharpening Spatial Filters: Foundation ► The first-order derivative of a one-dimensional function f(x) is the difference ► The second-order derivative of f(x) as the difference ( 1) ( ) f f x f x x      2 2 ( 1) ( 1) 2 ( ) f f x f x f x x       
  • 82. 4/3/2023 82 Sharpening Spatial Filters: Laplace Operator The second-order isotropic derivative operator is the Laplacian for a function (image) f(x,y) 2 2 2 2 2 f f f x y        2 2 ( 1, ) ( 1, ) 2 ( , ) f f x y f x y f x y x        2 2 ( , 1) ( , 1) 2 ( , ) f f x y f x y f x y y        2 ( 1, ) ( 1, ) ( , 1) ( , 1) -4 ( , ) f f x y f x y f x y f x y f x y         
  • 83. 4/3/2023 83 Sharpening Spatial Filters: Laplace Operator
  • 84. 4/3/2023 84 Sharpening Spatial Filters: Laplace Operator Image sharpening in the way of using the Laplacian: 2 2 ( , ) ( , ) ( , ) where, ( , ) is input image, ( , ) is sharpenend images, -1 if ( , ) corresponding to Fig. 3.37(a) or (b) and 1 if either of the other two filters is us g x y f x y c f x y f x y g x y c f x y c           ed.
  • 86. 4/3/2023 86 Unsharp Masking and Highboost Filtering ► Unsharp masking Sharpen images consists of subtracting an unsharp (smoothed) version of an image from the original image e.g., printing and publishing industry ► Steps 1. Blur the original image 2. Subtract the blurred image from the original 3. Add the mask to the original
  • 87. 4/3/2023 87 Unsharp Masking and Highboost Filtering Let ( , ) denote the blurred image, unsharp masking is ( , ) ( , ) ( , ) Then add a weighted portion of the mask back to the original ( , ) ( , ) * ( , ) mask mask f x y g x y f x y f x y g x y f x y k g x y     0 k  when 1, the process is referred to as highboost filtering. k 
  • 89. Figure 3.55 (a) Unretouched “soft-tone” digital image of size 469×600pixels (b) Image blurred using a 31×31 Gaussian lowpass filter with σ = 5. (c) Mask. (d) Result of unsharp masking using Eq. (3-65) with k = 1. (e) and (f) Results of highboost filtering with k = 2 and k = 3, respectively.
  • 90. 4/3/2023 90 Unsharp Masking and Highboost Filtering: Example
  • 91. 4/3/2023 91 Image Sharpening based on First-Order Derivatives For function ( , ), the gradient of at coordinates ( , ) is defined as grad( ) x y f x y f x y f g x f f f g y                           2 2 The of vector , denoted as ( , ) ( , ) mag( ) x y magnitude f M x y M x y f g g      Gradient Image
  • 92. 4/3/2023 92 Image Sharpening based on First-Order Derivatives 2 2 The of vector , denoted as ( , ) ( , ) mag( ) x y magnitude f M x y M x y f g g      ( , ) | | | | x y M x y g g   z1 z2 z3 z4 z5 z6 z7 z8 z9 8 5 6 5 ( , ) | | | | M x y z z z z    
  • 93. 4/3/2023 93 Image Sharpening based on First-Order Derivatives z1 z2 z3 z4 z5 z6 z7 z8 z9 9 5 8 6 Roberts Cross-gradient Operators ( , ) | | | | M x y z z z z     7 8 9 1 2 3 3 6 9 1 4 7 Sobel Operators ( , ) | ( 2 ) ( 2 ) | | ( 2 ) ( 2 ) | M x y z z z z z z z z z z z z            
  • 94. 4/3/2023 94 Image Sharpening based on First-Order Derivatives
  • 96. 4/3/2023 96 Example: Combining Spatial Enhancement Methods Goal: Enhance the image by sharpening it and by bringing out more of the skeletal detail
  • 97. 4/3/2023 97 Example: Combining Spatial Enhancement Methods Goal: Enhance the image by sharpening it and by bringing out more of the skeletal detail