CSE 5524 Homework Assignment #4 solved




5/5 - (3 votes)

1) Write a function to compute the 7 similitude moment shape descriptors. Test and
compare results on the rectangle box images ‘boxIm[1-4].bmp’ on the website. How
do they change across the box images? Please make sure your function will work with
non-binary (grayscale) imagery (you will need this for later assignments), i.e., do not
use Matlab’s regionprops function for the mean or area in your calculations. [4 pts]
Nvals = similitudeMoments(boxIm1);
2) Using the datafile (eigdata.txt) provided on the WWW site, perform the following
MATLAB commands [1 pt]:
%% Load the data
clear; close all;
load eigdata.txt;
X = eigdata;
%% mean-subtract data
m = mean(X);
Y = X – ones(size(X,1),1)*m;
3) Compute the eigenvalues (V) and eigenvectors (U) of the data (stored in Y) using the
function eig() in Matlab (recall that you use either the covariance matrix or the
inverse-covariance matrix of the data – see class notes). Plot the mean-subtracted
data Y and the 2-D Gaussian ellipse axes for given the eigenvectors in U (you can use
the plot command in Matlab for this). Use the eigenvalues in V to give the
appropriate 3σ (standard deviation – not variance!) length to each axis (did you
compute the eigenvalues from the covariance or inverse covariance of Y? The
eigenvalues will be related but different! See class notes). [4 pts]
[Note: it would also be nice to draw the 3σ ellipse around Y if you can – Google
‘matlab ellipse.m’ for some code if you are interested.]
4) Rotate Y using the eigenvectors to make the data uncorrelated (i.e., project data Y
onto the eigenvectors – see class slides). Plot the results. [2 pts]
5) Turn in all code, printouts of images, and discussion of results. Make a script to do
the above tasks and call needed functions. Upload your code and images to Carmen
(use the required naming convention for your files). [no points for this last step
From now on you MUST submit all code and imagery on Carmen and turn in a paper
report in class to receive points on the homework. Any portion missing will result in a 0 for
the assignment!