You are on page 1of 5

A02: Point Operations, Filtering, and Frequency Domain

September 18, 2010

Assignment Brief
Student name and no. T.N.Chandrapala 070059B

Course EN4551: Fundamentals of Machine Vision & Image Processing

Assessment A02: Point Operations, Filtering, and Frequency Domain
Weight This amounts to 10% of the module grade. Late penalty is 33% per week.
Outcome The student must experiment with simple image processing algorithms
related to point operations, filtering and frequency domain.
Date handed out September 21, 2010 Date due October 19, 2010
Submission date 26-10-2010

Student’s Declaration
I confirm that the work submitted for this assignment is my own.
Student’s signature Date 26-10-2010

Student’s comments Ref:



Grade Lecturer’s signature Date

University of Moratuwa, Sri Lanka Page 1 of 2 Ranga Rodrigo


The object of interest was separated from the

image and its histogram was calculated. As a
similar sized object was to be located in a given
picture, the total image was scanned panning The program is able to draw a border around
from one end to the other selecting similar the detected region if the correlation is high
sized pixel blocks. Histograms of these image enough to be an actual match.
blocks were calculated, and correlation
between the histogram of the original object A02.2
and these subsequent histograms were
Spatial filtering was carried out as a convolution
calculated. The highest point of correlation was
of the image and the filter.
taken as the point of detection.

Gaussian Filter
The 2-D Gaussian function was used to create a
Gaussian filter. An image was added with noise
Figure 1: Object identification using histogram
to create a noisy image, and it was convolved
with the filter.
Figure 2: Gaussian Filtering

The mean absolute difference (MAD) was

calculations are as follows.
• Original and Image with noise: 14.41
Figure 4: Median Filtering
• Original and filtered image: 8.21
The mean absolute difference (MAD) was
Average Filter calculations are as follows.
A simple 3x3 averaging kernel was convolved • Original and Image with noise: 11.3
with the image with noise.
• Original and filtered image: 8.4

Un-sharp filter
The theory behind this filter is the creation of a
sharpening mask by taking the difference
between an image that need to be sharpened
and its blurred version. Then the mask is added
to the image itself to create the sharp image.
Figure 3: Mean Filtering

MAD calculations are as follows.

• Original and Image with noise: 14.41
• Original and filtered image: 8.27

‘img1’ has been created by convolving it with a

Median Filter Gaussian kernel. It is referred as the blurred
The median filter is very effective against ‘salt image. Then it is recovered using the algorithm.
and pepper’ noise.

Figure 5: Sharpening image

Sharpening using Laplace filter

Figure 7: Original and translated images by (20,20)

A Blurred image is sharpened using a Laplace Results:

mask. By convolving the Laplace filter with the
blurred image the edged become highlighted.
Then this mask is added to the blurred image to
get a sharper result.

The peak appeared in the point corresponding

to (20,20) as expected in the phase correlation
Figure 6: Sharpening using Laplasian plot.
This method seems to create sharper images
than unsharp masking. A02.4
The methodology in the paper “An FFT-Based
A02.3 Technique for Translation, Rotation, and Scale-
The image and its translated version were Invariant Image Registration” was
transformed into the Fourier domain. The cross implemented.
power spectrum R was calculated. And the
inverse Fourier transformation was taken. The
peak value corresponds to the translation.

Figure 8: Origanal Vs Translated, rotated and scaled image

An initial image was loaded and it was Accuracy:
subjected to translation, rotation and scaling. Actual Result
Then the FFT of the two images was taken. Rotation 20 deg 19.6 deg
Scaling 2 1.99
Rotation 30 deg 29.6 deg
Scaling 1.25 1.23
After obtaining the Rotations and Scaling
factors the effects were reversed to crate same
sized images with same orientation. But the
translation remained the same.

The highpass filter was designed according to

the specifications of the paper. After passing
through the highpass module, log-polar
transformation was done. This was done using
logsample.m. The inputs to this function are the
image, the maximum and minimum of the
radius, the starting coordinates, the number of
samples in the angle and radius. The natural The two images after re-scaling and reverse
logarithm has been used. rotation was converted to the Fourier domain
After considering the two results as translated and a phase correlation was carried out as
images themselves, a phase correlation was before to get the translation. The results are as
done to get the translations follows. (The translation in the given scenario is
zero when Tx=Ty=88)

Actual Result
X=18; Y=8 X=19; Y=9
X=15; Y=15 X=16; Y=16

Figure 9: Rotation and Scaling

The translation in the X axis gives the scaling

and Y axis gives the rotation. To obtain the
actual values, the two translation values were
scaled as given in the code. (Theta and sc
Figure 10: Translation