Question: 1 : 1 3 Done Lab 1 . pdf 2 of 3 You will notice that sI does not display correctly, whereas ssI does display

1:13
Done
Lab1.pdf
2 of 3
You will notice that sI does not display correctly, whereas ssI does display correctly. Explain why, by examining the values in the arrays sI and ssI. Note that you should use the image conversion functions im2uint8, im2single, im2double, etc., to obtain images that will display correctly with imshow.
6. For the following exercises, create a new script file Lab1Ex2.
(a) Use the command imread to read in the RGB image 'football.jpg' into the array named A and display it using the imshow command. Use the whos command to display the type of image. Note that this image has three image planes, each plane corresponding to a different color. Pull out the red component of the image using the command Ared=A(:,:,1). Display Ared using the imshow command.
(b) Read in an indexed color image using the command [T,map]=imread('trees.tif'). Display the image trees.tif using the command imshow (T), and then using imshow(T,map). What do you notice? Explain the difference in what is displayed in the two cases. How many distinct colors are there in this image and how did you determine this?
(c) Now let us play around with the color map. Construct a new colormap, in an array called newmap, which is of the same size as the array map, except that the first column of newmap is the second column of map, the second column of newmap is the third column of map, and the third column of newmap is the first column of map. Now display the image trees using the command imshow (T,newmap). What do you notice?
7. For this exercise, create a script called 'Lab1SyntheticImage'
(a) Construct a synthetic RGB image of size 256256 pixels. The background should be green. In middle there should be a red circle, whose center is at the pixel (128,128), and the radius of the circle should be 16 pixels. There should be a blue square of side 6 pixels in the bottom left hand corner of the image. There should be a yellow square of side 6 pixels in the upper right hand corner of the image. Now construct the same image in indexed format.
8. For the following exercises create script called Lab1RectWindow.
(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.
 1:13 Done Lab1.pdf 2 of 3 You will notice that sI

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!