Polytechnic University, Dept. Electrical and Computer Engineering
Total Page:16
File Type:pdf, Size:1020Kb
Polytechnic University, Dept. Electrical and Computer Engineering EE3414 Multimedia Communication System I Spring 2003, Yao Wang ______
Homework 10 (Image Resizing) (Due 4/15/2003)
Written Assignment:
1. For the 4x4 image S given below 10 15 20 10 5 20 15 15 S 5 10 20 10 10 15 10 15 a. Determine the down-sampled images (by a factor of 2 in both horizontal and vertical direction) using the following method: i. No-prefiltering ii. Using averaging filter (averaging 2x2 pixels) b. Determine the interpolated image (by a factor of 2 in both horizontal and vertical directions) from the image produced in a(i) using i. Pixel replication ii. Bilinear interpolation. (for the last row and column, you can repeat the previous row and column) c. Repeat (b) but starting from the image produced in a(ii). d. Comment on the image quality obtained with different options.
Computer Assignment (Note: You are required to submit your lab report. It will be counted towards your final grade)
For this set of assignment, you need to use Matlab with image toolbox. This software is available in the multimedia lab (LC008). The lab will be open for this class on Wed 1-5 PM and Fri 1-5 PM. There will be a Lab assistant in the lab during these hours. As submission for this homework, you should record your experiment steps and observation. If you cannot access the lab at the above hours, please email the TA ([email protected]) to arrange for other times. The matlab programs and images are downloadable from the course website. The link to USC image database contains many other good test images (use the Miscellaneous category).
1. The matlab program “resize_exp.m” does the following: down-sample an image by a factor of 2 without prefiltering, and then up-sample the down-sampled image by a factor of 2 using different interpolation filters (nearest neighbor, bilinear, and bicubic). It also display the spectrum (magnitude of 2-D DFT) of the resulting image. Go through the matlab script to try to understand what does each step do. Use this program on the test image “barbara_gray.tif’’. Observe both the images and their DFTs. Comment on the quality of each processed image, and also comment on how the DFT of each processed image changes from the DFT of the original image.
Note: I have added a “pause” command after each processing to give you time to observe the intermediate result. Hit any key to continue. Also, if your screen get cluttered with too many images, use “close all” command to close all the figure windows.
2. Modify the given program so that the down-sampled image is obtained with prefiltering using a filter of length 2. Apply the program again on the same image. Compare the result of each step with the one obtained from Exp. 1. Comment on the differences.
As part of the report, you should include the images and DFT plots and your comments about image quality, DFT features, etc.
Optional: Some other good images to try are “baboon_gray.tif”, “resolution_chart_gray.tif”, “aerial_gray.tif”. You may also want to try the following: directly up-sample by a factor of 2, down-sample by a factor of 4 and then up-sample by a factor of 4. The “imresize” function in matlab also work with color images. But you may not want to apply DFT on the color images directly. So to try out your program on a color image, you may want to block out the lines in the provided matlab script that compute and display DFTs.