0% found this document useful (0 votes)
72 views2 pages

Lab 3 - 2

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Addis Ababa Institute of technology

Center of biomedical engineering


Digital image processing
Lab Session 3

Title: Histogram Equalization, Fourier transform and Filtering.

Objective: To understand histogram equalization, Fourier transform and the application of


different filters on the images.

Theory: Histogram equalization is a technique for adjusting image intensities to enhance


contrast. Equalization implies mapping one distribution (the given histogram) to another
distribution (a wider and more uniform distribution of intensity values) so the intensity values
are spreaded over the whole range. There are two types of histogram equalization techniques:
global histogram equalization is a process over the entire area and Local histogram equalization
which takes specific area of the image by using windows of different size.

Fourier transformation belongs to a class of digital image processing algorithms that can be
utilized to transform a digital image into the frequency domain. After an image is transformed
and described as a series of spatial frequencies, a variety of filtering algorithms can then be
easily computed and applied, followed by retransformation of the filtered image back to the
spatial domain. Filtering in image processing is a process that cleans up appearances and allows
for selective highlighting of specific information. Filtering an Image is useful for many
applications, including smoothing, sharpening, removing noise, and edge detection. A filter is
defined by a kernel, which is a small array applied to each pixel and its neighbors within an
image.

Exercises:

1. Histogram equalization

1.1 Consider the image square.tif. Use both global histogram equalization and local
histogram equalization (computed over 3 x 3, 5x5 and 7x7 localizing windows) and
generate the results. Discuss the effects of window size. See MATLAB function histeq.

1.2 For the images ‘Lake.jpg’, equalize the R, G and B images separately as previously and
convert the images back to jpg format. Comments.
2. Fourier Transform

Consider generating a 256*256 image with the middle part a rectangular mask of dimension mn
(similar to the one presented on pp. 268 of Gonzalez and Woods, 3rd Edition) and do the
followings in Matlab:

2.1 Plot the corresponding (Fourier) amplitude spectrum.


2.2 Translate the rectangle by some amount to the up-right direction and plot the resulting
image and the corresponding amplitude spectrum. Was the amplitude different from
the amplitude you computed in part (2.1) above?
2.3 Now rotate (instead of translating) the rectangle and plot the resulting image and its
corresponding amplitude spectrum. Write down what you observed. Use a centered
spectrum and a log scale when you plot the spectrum in cases (2.2) through (2.3)
2.4 In all cases compute and plot the phase spectrum and write down what you observed.
(Hint: use atan2 Matlab function).

3. Filtering

3.1 Implement the median filter on the T1 weighted Magnetic Resonance image first
randomly pick 4000 pixels and set their values to zero to obtain a pepper noise
corrupted image. Then apply the median filter with W = 3, i.e. 3x3 median filter. Use
5*5, 7*7 filters to improve the result. Try simple averaging filter of same size as the
median filter and compare the results. Comments
3.2 Taking notably the images ‘cell’ and ‘fibers2’, Try smoothing, look at the Matlab
functions imfilter and fspecial, notably average and Gaussian. What happens as the filter
size increases?
3.3 Image sharpening: To counter-balance the effects of smoothing, try image sharpening.
Use Matlab functions using low-pass versions and Laplacian ones with ‘unsharp’ version
of fspecial. Comments.

You might also like