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

AOE 5404 Homework 5: Due On Feb. 26, 2025

The document outlines Homework 5 for AOE 5404, due on February 26, 2025, which consists of two main problems involving image processing using singular value decomposition (SVD). Problem 1 focuses on image compression with a provided image 'rose.jpg', requiring students to perform SVD, visualize results, and analyze storage costs. Problem 2 involves feature extraction from a sequence of 55 grayscale images related to fluid-structure interaction, requiring similar SVD applications and visualizations of the extracted features.

Uploaded by

celin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

AOE 5404 Homework 5: Due On Feb. 26, 2025

The document outlines Homework 5 for AOE 5404, due on February 26, 2025, which consists of two main problems involving image processing using singular value decomposition (SVD). Problem 1 focuses on image compression with a provided image 'rose.jpg', requiring students to perform SVD, visualize results, and analyze storage costs. Problem 2 involves feature extraction from a sequence of 55 grayscale images related to fluid-structure interaction, requiring similar SVD applications and visualizations of the extracted features.

Uploaded by

celin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AOE 5404 Homework 5

Due on Feb. 26, 2025


Problem 1 [4 pts]: Image compression using singular value decomposition (SVD).
Download “rose.jpg” and visualize it.

(1) Load the image into Matlab using the built-in function “imread”, e.g., A = imread('rose.jpg');
The output “A” is a matrix with each entry corresponding to a pixel of the image. What are the dimensions (i.e. numbers
of rows and columns) of the matrix? Visualize the image in Matlab using “imshow(A)”.
(2) Perform SVD on matrix A, using the Matlab built-in function svd. (Hint: The output of imread is an integer matrix.
Before applying SVD, you need to convert it into a real-valued matrix, e.g., by A = double(A).) How many singular
values does the matrix have? Plot the first (i.e. largest) 100 singular values.
(3) Approximate matrix A by a reduced-order (i.e. lower-rank) orthogonal basis, using the first 𝑟𝑟 singular values. Visualize
the images obtained using 𝑟𝑟 = 1, 5, 20, 50, 100. (Hint: If you use “imshow(…)” to visualize a matrix, the matrix needs
to be converted back to an (unsigned) integer matrix. This can be done using function uint8(…).)
(4) What is the storage cost in the case of 𝑟𝑟 = 100 (i.e. how many numbers need to be stored)? How does it compare with
the cost of storing the original image?

Problem 2 [6 pts]: Feature extraction through singular value decomposition (SVD).


Download VIV_frames.zip, and unzip it. You will find a folder that contains a sequence of 55 grayscale images. These
images are simulation results of a fluid-structure interaction problem featuring vortex-induced vibration (VIV). Each image
shows a snapshot of fluid vorticity and structural deformation. The file names of the images are ordered properly such that
playing through the images (001 – 055) recovers the time-history of fluid vorticity and structural deformation. The objective
of this problem is to extract the main features of these images using SVD.
(1) Load the first image, “ezgif-frame-001.jpg”, into MATLAB using the built-in function “imread”:
M = imread('VIV_frames\ezgif-frame-001.jpg');
The output “M” is a matrix with each entry corresponding to a pixel of the image. What are the dimensions (i.e. numbers
of rows and columns) of the matrix? How many pixels does the image have? [1 pt]
(2) Convert matrix M into a column vector 𝒂𝒂(𝟏𝟏) of the form
𝒎𝒎𝟏𝟏
𝒎𝒎
⎛ 𝟐𝟐 ⎞
𝒂𝒂(𝟏𝟏) = ⎜ ⋮ ⎟,
𝒎𝒎𝒏𝒏−𝟏𝟏
⎝ 𝒎𝒎𝒏𝒏 ⎠
where 𝒎𝒎𝒊𝒊 is the i-th column of matrix M. The superscript (1) indicates that this is the first image from the sequence.
What is the dimension of vector 𝒂𝒂(𝟏𝟏) ? What are the maximum and minimum values of the entries of 𝒂𝒂(𝟏𝟏) ? [1 pt]
(3) Following the same procedure, load all the 55 images and form a matrix A that has 55 columns, i.e.
𝑨𝑨 = �𝒂𝒂(𝟏𝟏) 𝒂𝒂(𝟐𝟐) 𝒂𝒂(𝟑𝟑) … 𝒂𝒂(𝟓𝟓𝟓𝟓) 𝒂𝒂(𝟓𝟓𝟓𝟓) �.
Note that 𝑨𝑨 is considered as an integer matrix in MATLAB. Convert it into a matrix of real numbers by A = double(A).
Now, perform the singular value decomposition (SVD) on matrix 𝑨𝑨, using the built-in function “svd”. (This may take
a few minutes.) Using the built-in function “bar” in MATLAB, plot all the singular values of 𝑨𝑨 in a bar chart. What is
the ratio between the largest and the smallest singular values? [2 pts]
(4) Let 𝜎𝜎𝑖𝑖 denote the i-th singular value of 𝑨𝑨, 𝒖𝒖𝒊𝒊 denote the i-th column of 𝑼𝑼, and 𝒗𝒗𝒊𝒊 the i-th column of 𝑽𝑽. Each matrix
𝑨𝑨𝒊𝒊 ≡ 𝜎𝜎𝑖𝑖 𝒖𝒖𝒊𝒊 𝒗𝒗𝑻𝑻𝒊𝒊
represents a “feature” of the data set 𝑨𝑨. Convert 𝑨𝑨𝟏𝟏 (i.e. 𝑖𝑖 = 1) into an integer matrix by A1 = uint8(A1). Then,
convert 𝑨𝑨𝟏𝟏 back to a sequence of 55 images. Print the first image in this sequence using function “imshow”. [1 pt]
(5) Repeat part (4) for 𝑖𝑖 = 2, 4, 6. For each feature extracted, print one or a few representative images. If an image is too
dark or too bright, rescale it to 0 – 255 so that the feature can be clearly observed. Briefly describe the features extracted.
[1 pts]

You might also like