Cristian Vargas ECE 3101L Lab Report #4
Cristian Vargas ECE 3101L Lab Report #4
ECE 3101L
Lab Report #4
Image Processing
December 9, 2024
Cristian Vargas
Table of Contents:
Executive Summary………………………………………………………………………………3
Theory/Background………………………………………………………………………………4
Image Resizing……………………………………………….……….…….……………4
Filtering Images……………………………..….………………………………..………6
Image Equalization………………..…………………………..…...…………………….9
Gaussian Filters………………………………………………………………………….12
Lab/Data Anlysis…………………………………………………………….…………………13
Image Resizing…………………………………………………………………………13
Filtering Images…………………….………………………………………………..…14
Image Equaliztion………………....…….………………………………………………15
Gaussian Filters………………………………………………………………………….17
Error Analysis……………………………………………………………………………………19
Vargas 3
Executive Summary:
The purpose of this report is to understand, test, and conclude our findings relating to the various
image processing methods (image filtering, image equalization, gaussian filters, etc.). This is
done by determining the theory of these processing methods, gathering data using these methods,
Theory Background:
To understanding Image Resizing, we must first make sure we understand how images
are interpreted in the digital sense. Digital images are comprised of various pixels, which
comprise the entire image that we see on a screen. The image has some resolution (1000 x 1000
for example) and can be scaled up or down by using various mathematical models.
If we intend to make an image smaller, we can scale and image down from 1000 x 1000
pixels to 500 x 500 pixels, for example. We can characterize the proportional shrinking of an
n
1
=proportion of pixels ¿
2
Using the above expression, we can determine the proportional amount of pixels left in
an image by using the amount of times we desire to reduce the image. If we desire to reduce the
1
image by 3 times, we can say that the image will have roughly of the original pixels. This also
8
7
means that of the original data is lost however. This will be noticed when the image is scaled
8
n
2 =amount of pixels added
Although we are adding more pixels to the image, we are not inherently increasing the
quality of the image, as the new pixels will be procedurally determined by the surrounding pixels
Nearest interpolation, which determines the value of the newest pixel by selecting a value
Bilinear interpolation, which determines the value of the newest pixel based on a
Bicubic interpolation, which determines the value of the newest pixel based on a
We can gather that the larger the pixel neighborhood, the smoother or softer the image is.
This is important in terms of image anti-aliasing which is intended to reduce the over sharpness
Filtering Images:
Just like we can apply various filters to analogue signals in a circuit, we can also apply
similar filters to images in the digital sense. In order to interpret how low-pass and high-pass
filters work with digital images, we must first understand how they work with a square wave.
Using a Low-Pass filter, we can see that the signal is more likely to pass the portion of the square
wave signal that has a lower frequency, or lower tendency to change. This is reflected in how the
When applying a High-Pass filter to a square wave signal, we can see that the portion of
the filter which is passed is the portion of the square signal which experiences the highest rate of
In term so images and applying these filter to digital signals, we can associate the change
in the values relative to the surrounding pixel values. If a pixel is very similar to the neighboring
pixels then it can be characterized by a low frequency signal. If the pixel is far more different
relative to the surrounding pixels, then we can characterize it as a high frequency signal. The
high and low pass filters will remove each of these signals accordingly.
Filters can be done in MATLAB through the use of matrices to represent the output of the
filter relative to the center pixel and the surrounding pixel values.
In this matrix, we can see that the center pixel is passed while the surrounding pixels are
completely attenuated. This filter would act as a buffer, as the center pixel value is not changed at
all and the surrounding pixel values are not considered in determining the new center pixel value.
Vargas 8
This filter would act as a Low Pass filter as the filter weighs each of the surrounding
pixels equally when determining the new center pixel value. This filter would smooth the digital
This filter weighs the side values far more than the corner values. Although this still acts
like a Low Pass filter, this would smooth the image significantly less as the weight for the center
The High Pass Laplacian filter amplifies the contrast between the center pixel and the
surrounding pixels. This would cause the output image to show more of the contrasting pixel
This matrix can be used to shift the entire image to the left, using the pixel value which is
directly to the right of the center pixel. When this is repeated multiple times, this can cause an
extension type effect on the right side of the image, as there is no pixels to the right of the right
the image. The intention of doing this is the balance the image such that it isn’t overly bright or
overly dark. This is done by considering a cumulative sum histogram. A cumulative sum
histogram depicts a summation of each of the histogram values, but relative to the complete
Images are not just interpreted in the spatial domain, but also the frequency domain,
which is used to understand the relative changes of pixel values. This is often used by computers
In the above image, we can see that as the number of lines is increased in the above
images, the frequency of the sine wave under them increases. This is showing how the frequent
change from black to white and vise versa reflects high frequency within the image.
The orientation of the lines also have an influence on the depiction of an image in the
frequency domain.
Using the line example we can expect that the resulting image in the frequency domain
will reflect in an image which is in a perpendicular orientation to the lines in the spatial domain.
Vargas 11
From the above image, we can see that the vertical lines produce simple dots in the
frequency domain, but as the orientation of the lines is rotated or the frequency is increased, the
dots are at different angles or distances from the origin of the picture.
As we can see from the above image of a man taking a photograph, the frequency domain
image representation of the image shows lines which are perpendicular to the major lines of
Gaussian Filters
The sigma parameter in the Gaussian function determines the standard deviation of the
Gaussian distribution and directly affects the filter’s characteristics. A gaussian low pass filter
with a larger sigma component will introduce a stronger smoothing effect to the image, applying
a stronger blur. One with a smaller sigma will cause an inverse effect and lead to a milder
blurring. A gaussian high pass filter with a larger sigma value will filter out high contrast and
sharper detail in an image, while a smaller sigma value will amplify less subtle components of
Lab:
We will first see how the resizing algorithm alters the original image of the flower:
Finally, we can attempt to reverse the shrinking process by resizing the reduced image
using the three previously discussed methods: nearest, bilinear, and bicubic. From a visual
techniques. This improvement arises from the increasing number of pixels referenced when
generating new pixels during the resizing process. As a result, the contrast between individual
pixels becomes less pronounced, producing a "smoother" and more refined image, particularly
with bicubic resizing. Conversely, the nearest neighbor method results in the most visibly
Filtering Images
We can see that the Low Pass filter greatly smooths the originally grainy image, while the
High Pass filter greatly introduces noise. This confirms our prior understanding of how HPF and
We can also test the effects of the left shift matrix on the crane image.
Looking at the image, we can confirm our prior understanding of the left shift matrix to
also be true. We see not only was the image significantly shifted to the left, but we see an
extension of the right most pixels in the far left of the image.
Vargas 15
Image Equalization
Using the crane image, we can test the effects of image equalization on digital images.
First considering the histogram of the original image, we can see a clear density of number of
pixels in the 75 to 100 range. We will note this for after the image equalization. Also, the
cumulative sum of histogram shows that there is a considerable increase in pixel density in the
middle and upper portion of the black and white color spectrum. This will be significantly
Considering the equalized image, we can see that the image has a more even distribution
of blacks and whites in it. Considering the histogram, we can see that the region that was
significantly dense has been extended laterally, showing that the region with the highest pixel
count now ranges from 75 to 150 on the black and white spectrum. Finally, the cumulative sum
of histogram is a completely linear line. This supports that the image is indeed equalized such
that the cumulative sum of histogram function increases at a constant rate throughout the image.
Vargas 16
When considering the frequency domain interpretation of the crane images, we will
mainly look at the FFT log scale interpretations of the two images. This is largely because there
isn’t much information to gather from the “FFT of Image” and “FFT center origin” images.
Looking at the FFT log scale image for the top crane picture, we see that there is a large
density of white pixels at the origin of the image, but a gradient to black pixels as we move away
from the center of the image. This is largely because this image of the crane is the less grainy
image, meaning that there is less noise in the image. Due to the lower level of noise in the image,
the frequency domain interpretation is populated closer to the origin but not as much on the outer
limits.
Looking at the bottom image of the crane however, we can see that the FFT log scale
image is comprised of allot of white pixels throughout the image. This is because this image of
Vargas 17
the crane is the more grainy image, so the noise throughout the image is coming up on the FFT
Gaussian Filters
First considering a sigma value of 50, we can see how this will affect the various filtering
First considering the low pass filtering of the top, less noisy, crane image we can see the
image has been considerably smoothed. Next, looking at the high pass filter image, we can see
that the regions of the image that are still left are subtle outlines of the various edges in the
image. Considering that the low pass filter and the high pass filter removed complementary
portions of the image, the sum of the two images resulted in the recreation of the original image.
Now considering the bottom set of images, we notice that we will be passing the grainy
image of the crane through the gaussian filters. First, through the low pass filter, we notice the
subtle smoothing of the grainy image, but the more interesting result is when we take the high
Vargas 18
pass filter over the grainy crane image. When passing the image through the filter, as the purpose
of the high pass filter is to show the high contrast portions of the image, we see that the image is
practically unintelligible, due to the high amount of noise in the image. Similarly to the previous
image however, the original image can be reconstructed using the sum of the two complementary
output images.
Let us now consider how the Gaussian filter acts differently when the sigma value is
reduced to 2:
Considering the non-grainy crane image first, we see that when passed through the low
pass filter, the image is aggressively smoothed, making the subject basically undistinguishable.
The high pass filter however, is so gentle that the only a mild reduction in brightness is done in
the more low contrast portions of the image. Both of these characteristics are notices also in the
grainy crane image, with the exception of more noise is passed in the high pass filter of the
Error Analysis:
understand the properties of image processing and how images can be altered using various
filters and interpretations in the frequency domain. The lab provided valuable insights into the
application of Fourier transforms and how spatial and frequency domains are interconnected in
image analysis. Additionally, the results demonstrated how specific filters can enhance, suppress,
or modify image features, showcasing their practical applications in areas such as noise
reduction, edge detection, and equalization. Overall, this experiment deepened our understanding
of image processing techniques and their relevance in real-world scenarios. The topics covered in
this lab report could be applied in projects relating to object recognition in image processing,