Question: Write a Matlab function that takes gray image matrix F and 2 integer numbers R and C . The function will return an image matrix

Write a Matlab function that takes gray image matrix F and 2 integer numbers R and
C. The function will return an image matrix after deleting R rows and C columns randomly from
the image. This function Should perform it operations using loops. You cannot use any of the
predefined functions in Matlab for image resizing or cropping. The function should perform all
required error checking. For this question, you need to generate unique random numbers
because you cannot delete the same row 2 times. Rand and randn may give repeated randome
numbers. use p = randperm(n,k) to return a row vector containing k unique integers selected
randomly from 1 to n inclusive.
3.[10 Points] Write a Matlab function that asksthe user to input an image name, 2 integer numbers,
and an output image name. The function reads the image with the input image name using imread
and make sure that the image is loaded. The function then calls the function defined in the
previous question to perform the required image operation. Then, if the operation was successful,
the function saves the modified image to a file named as the output image name using imwrite.
4.[25 Points] Re-write Question 2 using victor (matrix) operations to perform the needed
operations.
5.[25 Points] Write a matlab script that runs the functions from questions 2 and 4 for 10 times each
on the rose_1024 image, [R,C]=(100,100), and measure the execution time of each run. Record
the execution time of each run in the following table and then calculate the average of the 15
runs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!