Lecture 03
Lecture 03
Gaussian Filter
◼ Point Processing
Image negatives
Log Transformation
montage({A,Ref,B})
title('Input Image (Left) vs Reference Image (Right) &
Output Image (Down)’);
%{
subplot(2, 2, 1), imshow(A), title ('Input Image');
subplot(2, 2, 2), imshow(Ref), title ('Reference Image');
subplot(2, 2, 3), imshow(B), title ('Output Image');
%}
Image Enhancement Domains
Image Enhancement Domains
Neighborhood
Histogram Point
Processing
Processing Processing
(Filtering)
Image Smoothing & Enhancing
Image smoothing, Noise removing, edge
enhancement and boundary detection are
local operations in image processing.
A Local operation is an operation that
transfer input image into an output image
depending on the neighborhood values of
input coordinates.
It means, if pixel b[x,y] is a pixel in
output image, it will be result based on
the a[x,y], the same pixel in input image
and the neighborhood pixel values.
Neighbors of A Pixel
Non-Linear
Linear Filtering
Filtering
Mean/Averaging
Median Filter
Filter
Max Filter
1/9
Mean / Averaging Filtering
Mean / Averaging Filtering
Kernel 5x5
MATLAB Hints
% mean filter with 3X3 mask/window size
I = imread("Lena2.png");
N = imnoise(I,'salt & pepper',0.03);
K = ones(3,3)/9;
noise_free = imfilter(N,K);
subplot(2,2,1), imshow(I), title ('Original Image');
subplot(2,2,2), imshow(N), title ('Noisy Image');
subplot(2,2,3), imshow(noise_free), title ('After
Noisy Removal');
Median Filter
Median, in statistics, is the middle value of
the given list of data when arranged in an
order.
Neighborhood
Histogram Point
Processing
Processing Processing
(Filtering)
Point Processing
Basic Gray Level Transformations:
image enhancement can be done by gray-
level transformation functions.
These are among the simplest of all image
enhancement techniques.
The values of pixels, before and after
processing, will be denoted by r and s,
respectively. s=T(r) Or
Where r is the pixels of the input image and s is the pixels of the
output image. T is a transformation function that maps each
value of r to each value of s.
Intensity Transformation Functions
Image Negatives /The Negative
Transformation
The negative of an image with gray levels
in the range [0, L-1] is obtained by using
the negative transformation
s = L - 1 - r.
The negative of an image with gray levels
in the range [0, L-1] is obtained by using
the negative transformation
Image Negatives /The Negative
Transformation
Image Negatives /The Negative
Transformation
The Negative Transformation
The Negative Transformation
MATLAB Hints
% reading the RGB file into the Matlab environment
I = imread("lena2.png");
subplot(1, 2, 1),
% displaying the RGB image
imshow(I);
title("Original image");
% levels of the 8-bit image
L = 2 ^ 8;
% finding the negative
neg = (L - 1) - I;
subplot(1, 2, 2),
% displaying the negative image
imshow(neg);
title("Negative Image")
Log Transformation
Log transformation to visualize patterns in
the dark regions of an image.
When the input grey level values may
have an extremely large rang of values.
E.g. Fourier Transform can have values in
the rang [0-106]
Log Transformation