Question: 1 : 1 3 Done Lab 1 . pdf 2 of 3 You will notice that sI does not display correctly, whereas ssI does display
:
Done
Labpdf
of
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 imuint imsingle, imdouble, etc., to obtain images that will display correctly with imshow.
For the following exercises, create a new script file LabEx
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:: Display Ared using the imshow command.
b Read in an indexed color image using the command Tmapimreadtreestif' Display the image trees.tif using the command imshow and then using imshowTmap 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 newmap What do you notice?
For this exercise, create a script called 'LabSyntheticImage'
a Construct a synthetic RGB image of size pixels. The background should be green. In middle there should be a red circle, whose center is at the pixel and the radius of the circle should be pixels. There should be a blue square of side pixels in the bottom left hand corner of the image. There should be a yellow square of side pixels in the upper right hand corner of the image. Now construct the same image in indexed format.
For the following exercises create script called LabRectWindow.
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 subimage, ie the image in the rectangular window must then be saved to a specific file. The script should display the original image and the subimage in separate windows.
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.
Write a script LabUpsideDown to read in the image peppers.png and display it upside down.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
