Question: Please help me with my MATLAB assignment. Will upvote Goal: Learn how to perform basic MATLAB operations with images (OPTIONAL) Learn how to use the


Please help me with my MATLAB assignment. Will upvote
Goal: Learn how to perform basic MATLAB operations with images (OPTIONAL) Learn how to use the MATLAB Live Editor Questions (the weight of each question is indicated): 1. (20%) Select four grayscale images available in MATLAB (e.g., pout, coins, cameraman, and rice) and write a MATLAB script to perform the following operations: a. Use imfinfo to read their file name and size (width and height, in pixels); b. Store the resulting information (image name, width, and height) into an array of structures; C. Save the array to a .mat file. 2. (15%) Write a MATLAB script to perform the following operations: a. Load the .mat file saved by the script for Question 1. b. Display the four images in a 2x2 arrangement (Hint: do not use subimage). 3. (25 %) Write a MATLAB script to perform the following operations: a. Read, open, and display a grayscale image available in MATLAB (e.g., pout, coins, cameraman, and rice) b. Calculate and display its maximum, minimum, and average gray level values. Hint: use imfinfo and sprintf 4. (20 %) Write a MATLAB script to perform the following operations: a. Open an image file (whose name should be input by the user, e.g., using uigetfile); b. Flip the original image upside-down; C. Flip the original image left side-right; d. Compute the negative of the original image e. Display the four images (original, negative, horizontally and vertically flipped) in a 2x2 arrangement (Hint: do not use subimage). 5. (20 %) A beginner MATLAB programmer wrote the code below to darken a grayscale image by reducing the intensity of each pixel by half. Please retype and run their code and answer the following questions: a. Does the script work as expected? b. Will it still work if you remove the uint8 typecasting in line 3? Why (not)? C. What is the main problem with this code? Be specific! d. Rewrite the code to improve its efficiency while keeping it readable. Hint: vectorize for loops! e. Compare the performance of the original code against the modified version you wrote, using tic and toc. 1 2 3 4 5 6 7 8 9 10 I - imread('coins.png'); [height width] = size(I); J = uint8(zeros(size(I))); for i=1:height for j=1:width Jli,j) = 0.5* Ili,j); end end imshow(I) figure, imshow (J) Bonus - up to 30% Combine all scripts into a "notebook" (Live Script in MATLAB parlance) and prepare your report directly from MATLAB by publishing the code, text, and results to PDF Deliverable: please submit (via Canvas 'Assignment Submission' option) one zip file containing: all relevant files (I expect one.m file per question, there is no need to submit image files, you can add the answers to the questions in Problem 5 as comments within the corresponding.m file) (OPTIONAL) the report in PDF format), if you chose to do the bonus part (OPTIONAL) the .mlx file, if you chose to do the bonus part any other relevant file (README, very unique images, etc.) that you might deem useful Goal: Learn how to perform basic MATLAB operations with images (OPTIONAL) Learn how to use the MATLAB Live Editor Questions (the weight of each question is indicated): 1. (20%) Select four grayscale images available in MATLAB (e.g., pout, coins, cameraman, and rice) and write a MATLAB script to perform the following operations: a. Use imfinfo to read their file name and size (width and height, in pixels); b. Store the resulting information (image name, width, and height) into an array of structures; C. Save the array to a .mat file. 2. (15%) Write a MATLAB script to perform the following operations: a. Load the .mat file saved by the script for Question 1. b. Display the four images in a 2x2 arrangement (Hint: do not use subimage). 3. (25 %) Write a MATLAB script to perform the following operations: a. Read, open, and display a grayscale image available in MATLAB (e.g., pout, coins, cameraman, and rice) b. Calculate and display its maximum, minimum, and average gray level values. Hint: use imfinfo and sprintf 4. (20 %) Write a MATLAB script to perform the following operations: a. Open an image file (whose name should be input by the user, e.g., using uigetfile); b. Flip the original image upside-down; C. Flip the original image left side-right; d. Compute the negative of the original image e. Display the four images (original, negative, horizontally and vertically flipped) in a 2x2 arrangement (Hint: do not use subimage). 5. (20 %) A beginner MATLAB programmer wrote the code below to darken a grayscale image by reducing the intensity of each pixel by half. Please retype and run their code and answer the following questions: a. Does the script work as expected? b. Will it still work if you remove the uint8 typecasting in line 3? Why (not)? C. What is the main problem with this code? Be specific! d. Rewrite the code to improve its efficiency while keeping it readable. Hint: vectorize for loops! e. Compare the performance of the original code against the modified version you wrote, using tic and toc. 1 2 3 4 5 6 7 8 9 10 I - imread('coins.png'); [height width] = size(I); J = uint8(zeros(size(I))); for i=1:height for j=1:width Jli,j) = 0.5* Ili,j); end end imshow(I) figure, imshow (J) Bonus - up to 30% Combine all scripts into a "notebook" (Live Script in MATLAB parlance) and prepare your report directly from MATLAB by publishing the code, text, and results to PDF Deliverable: please submit (via Canvas 'Assignment Submission' option) one zip file containing: all relevant files (I expect one.m file per question, there is no need to submit image files, you can add the answers to the questions in Problem 5 as comments within the corresponding.m file) (OPTIONAL) the report in PDF format), if you chose to do the bonus part (OPTIONAL) the .mlx file, if you chose to do the bonus part any other relevant file (README, very unique images, etc.) that you might deem useful
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
