Digital Image Processing: Lab 4: Image Enhancement in The Spatial Domain
Digital Image Processing: Lab 4: Image Enhancement in The Spatial Domain
Digital Image Processing: Lab 4: Image Enhancement in The Spatial Domain
Waqar Tanveer
Department of Computer Engineering
Bahria University, Islamabad
Masking Operations
Spatial Filtering
where,
f (x, y ) : Output Image
g (x, y ) : Input Image 1
h(x, y ) : Input Image 2
Digital Image Processing 5 / 24
Mathematical Operations: Subtraction
Mostly image subtraction is used for removal of background
from images, image matching, missing object tracing etc.
Figure: Masking
Digital Image Processing 12 / 24
Spatial Filtering
Task 2
Take any image of your choice, corrupt it by adding Gaussian
Noise and Salt and Pepper Noise. Compare and analyze
the result.
Hint: Use ”imnoise” MATLAB command.
Task 3
Perform noise removal by averaging multiple samples of an
image corrupted by gaussian noise. Show the effect of
averaging 5, 25 and 50 samples of noisy image. And comment
on the results.
Task 4
Take any image, corrupt it by adding gaussian noise and the
filter the image using 3x3 weighted smoothing mask. Do
analysis on result.
Task 5
Apply box filter mask of size 3x3,5x5,9x9,15x15 and 35x35 on
any gray scale image of your choice , show and comment on
the results.
Hint: Use ”fspecial” and ”imfilter” MATLAB commands.