Draft a flowchart for this task and save it as ma4_ind_1_flowchart_username.pdf.
Open the ENGR133_MATLAB_UDF_Template.mMATLAB template and complete the header information. Save your script as ma4_ind_1_username.m.
Create a MATLAB program that reads block.png image file and outputs the image to the screen as Figure 1 using the imshow command. Properly label this image as “Color Original Image”.
imread returns an array of row X column X frames. The number of frames for a colored image is generally ‘3’ (RGB) or ‘5’. Convert the image into a grayscale image using the built-in MATLAB function rgb2gray. Output the image to the screen as Figure 2 and label it as “Grayscale Original Image”
Use the menu function in MATLAB to ask the user to choose either the colored original image or grayscale image.
Example user options:
ChoosecoloredimageChoosegrayscaleimage
Use the menu function again to ask the user to select a flipping direction for the image they have chosen above.
a. ma4_ind_1_vertical_username.m, which flips the image vertically (i.e. over a horizontal line that runs through the center of the image). Use only nested for loops to rotate the image.
b. ma4_ind_1_horizontal_username.m, which flips the image horizontally (i.e. over a vertical line that runs through the center of the image). Use only nested for loops to rotate the image.
c. ma4_ind_1_diagonal_username.m, flips the image over a diagonal line that runs from the top left to the bottom right of the image. Use either nested loops or transpose/permute to rotate the image. Permute can be used to rearrange the dimensions of a multidimensional array.
Output the rotated image to the screen as Figure 3 and label the output “Image Flipped XX” where XX indicates the selection by the user (vertical, horizonal, or diagonal).
Publish ma4_ind_1_username.m as a PDF using one of the test cases and name it ma4_ind_1_username.pdf.