Unit II - Digital Image Fundamentals
Unit II - Digital Image Fundamentals
ENHANCEMENT
Unit II:
1
Fourier Transform
2
Discrete Cosine Transform
3
Source: Matlab
4
DCT
▪ Syntax of DCT
▪ B = dct2(A)
Where dct2(A) returns the two-dimensional discrete cosine transform of A. The matrix B contains
the discrete cosine transform coefficients B(k ,k ).
1 2
▪ B = dct2(A,m,n) ........(1)
Here,
A - Input matrix, specified as a 2-D numeric matrix.
m- Number of image rows, specified as a positive integer. dct2 pads image A with 0s or truncates
image A so that it has m rows. By default, m is equal to size(A,1).
n- Number of image columns, specified as a positive integer. dct2 pads image A with 0s or
truncates image A so that it has n columns. By default, n is equal to size(A,2)
▪ B = dct2(A,[m n]) .......(2)
Where (1) and (2) pad the matrix A with 0s to size m-by-n before applying the transformation.
If m or n is smaller than the corresponding dimension of A, then dct2 crops A before the
transformation.
▪ Example: https://www.mathworks.com/help/images/ref/dct2.html
5
Properties of DCT
6
Properties of DCT
▪ Example:
https://www.mathworks.com/help/wavelet/ug/haar-
transforms-for-time-series-data-and-images.html
8
Properties of Harr transform
11
Image enhancement
13
Application of Image enhancement
▪ Deblur images
▪ Contrast adjustment
▪ Brighten an image
▪ Smooth and sharpen
14
Histogram processing
15
Histogram processing
16
Histogram processing
17
▪ The histogram of a digital image with intensity levels
between 0 and (L-1) is a function h(rk) = nk,
▪ where rk is the k-th intensity level and nk is the number of
pixels in the image having that intensity level.
▪ For an N x N image, a normalized histogram function is
p(rk) = nk/N2 which is the probability of the occurrence of
a pixel with the intensity level rk.
18
▪ The histogram of an image consists of the x-axis
representing the intensity levels rk and the y-axis denoting
the h(rk) or the p(rk) functions.
▪ Histogram equalization is the process of uniformly
distributing the image histogram over the entire
intensity axis by choosing a proper intensity
transformation function.
19
MATLAB code
20
21
Frequency domain
22
Frequency domain
23
Frequency domain
25
Thank You
26