HW1: Basic Image Processing Operations
Learning Goals:
• Learn how to read and display Digital Image files in Matlab.
• Learn RGB and YcrCb color spaces.
• Learn subsampling, upsampling, interpolation, replication methods and MSE
computation in Matlab.
NOTE: You can work in the groups of two students each for Home Assignments, if you want.
Support Information:
A 704X536 color (24-bit per pixel) JPEG image (Flooded_house.jpg) is provided with this homework. The image is posted on the same page with this document.
- Read the Image: Matlab provides a command “imread” to read various image file formats. To read the image file provided with this project you can use, I = imread(‘filename.jpg’,’jpg’)
This command will open the image file and read the data into the array I. I is a three dimensional array with array dimensions I[1..800][1..600][1..3]. The third dimension is color band index.
- Display the image: Matlab provides a command “imshow” to display images. The image read as given above can be displayed simply by using the Matlab instruction, Imshow(I)
Project Description:
- Read and display the image using Matlab (10 points).
- Display each band (Red, Green and Blue) of the image file (15 points)
Hint: Red = I[:][:][1] captures the read component of the image and stores it into array Red. - Convert the image into YCbCr color space: (5 points)
3.1. Matlab provides a command “rgb2ycbcr” to convert an RGB image into a YCbCr image.
3.2. Matlab also provides a command “ycbcr2rgb” to convert a YCbCr image into RGB format.
- Display each band separately (Y, Cb and Cr bands). (10 points)
- Subsample Cb and Cr bands using 4:2:0 and display both bands. (10 points)
- Upsample and display the Cb and Cr bands using: (15 points)
6.1. Linear interpolation
6.2. Simple row or column replication.
- Convert the image into RGB format. (5 points)
- Display the original and reconstructed images (the image restored from the YCbCr coordinate). (5 points)
- Comment on the visual quality of the reconstructed image for both the upsampling cases. (5 points)
- Measure MSE between the original and reconstructed images (obtained using linear interpolation only). Comment on the results. (10 points)
- Comment on the compression ratio achieved by subsampling Cb and Cr components for 4:2:0 approach. Please note that you do not send the pixels which are made zero in the row and columns during subsampling. (5 points)
Report: Please use the Report Writing and Coding Guidelines provided in Home Work #1 to report your work. Some of the sample output images are also uploaded in this directory.


