1. Download the shirt.jpg (Fig. 2.15) and shirt-small.jpg (Fig. 2.16) images and load them into Matlab by...
Question:
1. Download the shirt.jpg (Fig. 2.15) and shirt-small.jpg (Fig. 2.16) images and load them into Matlab by using the following function: imagename = imread('filename.jpg');
Comment on the sizes of image matrices. What are the width and height of the images? What do these numbers correspond to?
2. On these images, find the color values of the pixels at locations (x=230;y=230) and (x = 148;y = 373).
3. Write the shirt.jpg image from Matlab into your hard drive. You can use imwrite function to do this. Use bitmap file format by the following code:
imwrite(imagename,'filename.bmp','bmp'); To find more info about imwrite function, you can type help imwrite in Matlab.
4. Compare the file sizes of shirt.bmp (from step 3) and shirt.jpg images. Which file is larger? Comment on differences.
5. View wall.jpg (Fig. 2.17), and observe the patterns on the wall. Comment on the patterns that you observed.
6. What is decimation? Explain in one or two sentences.
7. Decimate the shirt.jpg image horizontally by using the following filter: [0:250:50:25]. In order to do this first apply the filter to the rows and then down-sample the columns by 2. Comment on the size of the resulting image matrix.
8. Decimate the shirt.jpg image vertically by using the following filter: [0:25;0:5;0:25]. Comment on the size of the resulting image matrix.
9. Now, first decimate the shirt.jpg horizontally and then decimate the resulting image vertically. What are the width and height values of the final image? Also observe the final image and compare it with shirt-small.jpg. Comment on the differences.
10. Are down-sampling and up-sampling Linear Time-Invariant (LTI) systems? Prove your answers.
Numerical Methods for Engineers
ISBN: 978-9352602131
7th edition
Authors: Steven C. Chapra, Raymond P. Canale