Question: 1 : 1 5 Done Lab 1 . pdf 8 . For the following exercises create script called Lab 1 RectWindow. 3 of 3 a

1:15
Done
Lab1.pdf
8. For the following exercises create script called Lab1RectWindow.
3 of 3
a) The script should read in the image peppers.png, and use two mouse clicks and the command ginput to select and save part of the image in a given rectangular window. The two mouse clicks must identify the top left and bottom right corners of this window. The sub-image, i.e. the image in the rectangular window must then be saved to a specific file. The script should display the original image and the sub-image in separate windows.
2
Now use your script to pull out and save the part of the image in the smallest rectangular window that contains the yellow colored pepper in the middle of the image.
Test that you have written out the image correctly.
9. Write a script Lab1UpsideDown to read in the image peppers.png and display it upside down.
10. Write a script Lab1Interpolate for the following problems.
(a) Save the image file Chronometer.tif to your working folder and read in this file into an array.
(b) Downsample this image by 2k:1 in the vertical and horizontal directions (your script should allow you to set the value of k to one of the values 2,3,4). Store the downsampled image in a separate array. You will find it helpful to convert your image to type double, using the Matlab function im2double.
(c) Read the doc page for the Matlab function interp2 and use this to interpolate (upsample) the downsampled image back to its original size (it won't be exactly the same size as the original, but will be close).
(d) Display the original image and the interpolated image simultaneously.
(e) Set k=2 and determine which of the interpolation options is best, from a visual point of view.
(f) Repeat the observations for k=3 and k=4.
(g) Show your work, and describe your observations.
3
 1:15 Done Lab1.pdf 8. For the following exercises create script called

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 Databases Questions!