Description
ECE415 – HOMEWORK 1
Problem 1
Write a Matlab program to demonstrate the effect of the following 2D transformations: translation,
Euclidian, similarity, affine and projective. Transform three different polygons: equilateral triangle, square
and hexagon. Choose the polygon vertices as well as a single transformation matrix for each of the
transformations (total of 5 matrices).
1. Plot each input object and its 5 transformed versions. Clearly label axes and give each plot a
meaningful title.
2. Comment on what characteristics of the shape have been preserved by each of the
transformations.
3. Print out transformation matrices.
4. Print out in homogeneous & Cartesian coordinates vertices for each input object and each of the
transformed objects.
Please do not use any built-in functions except ones necessary for plotting and vector and matrix algebraic
operations. Submission should include a zipped file with homework report as a PDF file and Matlab code
as one or more .m files.
ECE415 – HOMEWORK 2
Problem 1
Load the grayscale image Image.bmp into Matlab.
1) Display the image
2) Thresholding
a. Select a threshold.
b. Perform thresholding on input image and display the resulting image.
c. Comment on effect thresholding had on the image.
d. What threshold value did you select and why?
3) Contrast stretching
a. Perform contrast stretching on input image and display the resulting image. The range of
pixel intensities that is being stretched should include 90% of the pixels, except for 5%
lowest valued and 5% highest valued ones. The target range is [0 255].
b. What was the range that was stretched?
c. Comment on effect contrast stretching had on the image.
4) Gamma correction
a. Select a gamma.
b. Perform gamma correction on the input image and display the resulting image.
c. What gamma value did you select?
d. Explain the expected behavior for such gamma value and point out the example(s) where
the modified image demonstrates such behavior.
5) Histogram equalization
a. Perform histogram equalization on the input image and display the resulting image.
b. Comment on effect histogram equalization had on the image.
Please do not use any built-in functions except ones necessary for plotting and vector and matrix algebraic
operations. Submission should include a zipped file with homework report as a PDF file and Matlab code
as one or more .m files.
ECE415 – HOMEWORK 3
Problem 1
Load the grayscale image Text.bmp into Matlab.
1) Display the image
2) Plot a histogram of image pixel intensities.
3) Perform thresholding on the image to create a binary image. Describe the method and threshold
used. Display the binary image.
4) Apply 5 times the erosion morphological operator on the binary image from part (3). Display the
resulting image. What size kernel did you use?
5) Apply 5 times dilation morphological operator on image obtained in (4). Display the resulting
image. What size kernel did you use?
6) Are the image obtained in (5) and the image in (3) identical? Comment!
7) Find the absolute difference of the image created in (3) and image created in (5). Map this
difference to full dynamic range of 8 bits and display. Comment!
8) Using the same kernel size, apply 10 times the erosion morphological operator on the binary
image from part (3). Display the resulting image.
9) Using the same kernel size, apply 10 times dilation morphological operator on image obtained in
(8). Display the resulting image.
10) Are the image obtained in (9) and the image in (3) identical? Are the images obtained in (5) and
(9) identical? Comment!
11) Find the absolute difference of the image created in (3) and image created in (9). Map this
difference to full dynamic range of 8 bits and display. Comment!
Problem 2
Find the distance transform of the image bottle.bmp.
1) Display the image.
2) Plot a histogram of image pixel intensities.
3) Perform thresholding to create a binary image. Describe the method and threshold used. Display
the image.
4) Process the image to create solid foreground object without any “holes”. Describe the exact
approach used. Display the image
5) Find the distance transform. What is the maximum value of the distance transform? How many
pixels have this value?
6) Map the values of distance transform to the full dynamic range of 8 bits and display the distance
transform. Comment!
7) What are the area, perimeter and centroid of the object in part (4)? How did you compute those?
Note: Do not use any built in Matlab functions except for plotting, image read in, matrix operation.
Note: All plots must have a meaningful title and clearly labeled axis.
ECE415 – HOMEWORK 4
Problem 1
Find the connected components in the image Connected.bmp.
1) Display the image
2) Perform thresholding if necessary to create binary image. Describe the method and threshold
used. Display the image.
3) Find the connected components using the component labeling two-pass algorithm assuming 4
connectivity. How many components are there?
4) Substituting the pixel values in binary image with the component number they belong to, and
mapping the component numbers to the full dynamic range of 8 bits display the image to
demonstrate the found connected components. Comment!
Problem 2
Load the image Image.bmp.
1) Display the image.
2) Create a Gaussian pyramid for the Image.bmp. The pyramid should have the original image and
four more levels. Display all five levels of the pyramid.
3) Create a Laplacian pyramid for the Image.bmp. The pyramid should have the original image and
four more levels. Display all five levels of the pyramid.
4) Comment on the difference between the Gaussian and Laplacian pyramid of the image.
Note: Do not use any built in Matlab functions except for plotting and image read in.
Note: All plots must have a meaningful title.
ECE415 – HOMEWORK 5
Problem 1
Detect features in the image ‘checkerboard.jpg’ using the Harris detector.
1) Display the image
2) Detect the features using Harris detector. Assume that the patches are of size 5×5 pixels.
a) Display the x-derivative, y-derivative.
b) Use Forstner-Harris metric to measure usefulness of the features.
c) Select features based on the value of local maximums. What threshold did you use?
Display image with marked locations of the selected features.
3) Use adaptive non-maximal suppression to select features.
a) Select same number of features as you had in part 3.
b) Display image with marked locations of the selected features.
c) Comment on the location of features in part 2 and part 3.
4) Rotate the original image by 45 degrees using built-in Matlab function imrotate(). Display the
rotated image.
5) Repeat steps 2 and 3 for the rotated image.
6) Match the features found using adaptive non-maximal suppression in the original image to the
ones found in the same way in the rotated image. For comparison use sum of squared
differences between patches. Keep in mind that before matching two features you have to
rotate both of them to align their orientation. How many features were matched? Display the
original image with marked locations of the matched features.
7) Repeat the above for the image ‘Image.bmp’
Note: Do not use any built in Matlab functions except for imrotate and to read in and display the image.
Note: All plots must have a meaningful title.