You are on page 1of 3

CSCI 576- Multimedia System Design Fall 2010 Homework 1 DUE: Noon (12pm), 9/27/2010

Description
Given an image with two resolutions, high and low, you are required to convert them into the following target resolutions: T1: 1920x1080 T2: 1280x720 T3: 640x480 1. For the high-res image, implement two or more different methods to change its resolution and thus map your original image to the three target ones. Here are the methods that we suggest: specific sampling, random sampling, Gaussian smoothing and then sampling, etc. (20 points) 2. Repeat the above for the low-res image, you can use nearest neighbor, bilinear or bicubic interpolation(20 points) 3. Discuss the difference between the two cases. (10 points) 4. Propose and implement a way to eliminate, or at least minimize the change in pixel aspect ratio. (20 points) A totally different way to address this problem is to perform seam carving. 1. Read the paper by Ariel Shamir and Shai Avidan in CACM http://portal.acm.org/citation.cfm?id=1435437 2. Download the code to perform scene carving and apply to the previous images http://code.google.com/p/seam-carving-gui/ (10 points) 3. Comment on the results, and discuss the pros and cons of each method. (20 points)

EXTRA CREDIT (20 Points)

1. Find a paper that discusses intelligent ways to up-sample and discuss the issues. (Hint: you may find it under super-resolution from a single image). (10 points) 2. Re-implement the algorithm (seam carving) described in Shamirs paper (10 Points). Before introducing the algorithm, lets take a look at its basic ideas. Suppose the resolution of original image is n*m, and the resolution of targeting image is n*m, you are only required to handle the case where m<m and n<n. The basic element of this algorithm is seam. A seam could either be a horizontal or vertical one. A vertical seam is defined as

and a horizontal seam is defined as

Based on the definition, we can tell a seam is a set of pixels. Lets consider a simple case first where m=m and n<n. the idea is to remove one horizontal seam each step, and repeat the removal process n-n times. The goal is to minimize the total cost of removing the pixels, which can be calculate by dynamic programming, please refer equation (5) in the paper. For the case of bi-direction, where m<m, and n<n, we need to remove the horizontal and vertical seams interchangeably. Let r = n n, and c = m m, then we have 2r+c combinations. Fortunately, our goal is to minimize the cost of removal, this problem, again, can be solved by dynamic programming. The idea is to only remember one value (i.e., the minimal value) of each image with resolution n1*m1, therefore, there are only r*c combinations, refer equation (7) in the paper.

Data
You are provided with four sample images at two resolutions to test your program.

Implementation
The name of your program must be HW1.exe For each input (a high-res image and a low-res image), your program should output 12 images For each method, three images sub-sampled from the high-res image, six images in total for two methods. To generate them, run HW1.exe input_image_path -s For each method, three images up-sampled from the low-res image, six images in total for two methods; To generate them, run HW1.exe input_image_path l

To eliminate or minimize the change in pixel aspect ratio, run HW1.exe input_image_path m s or HW1.exe input_image_path m l

If you want to do the extra credit of implementing seam carving, your program should output additional three images by running HW1.exe input_image_path sc You are not required to display the output images on the screen, just save the images as files on the local disk. In C#, you can read the input image using Bitmap bm = new Bitmap(string image_path); To create an image and save it as a file, using Bitmap bmNew = new Bitmap(int w, int h); // Assign the values to pixels bmNew.Save(string newImage_path); In Java, you can use BufferedImage image=ImageIO.read(new File(string image_path)); // assign or change values of pixels ImageIO.write(image, image_type, new File(string newImage_path));

Submission Guidelines
Your submission should have two parts: the source code of your program, and a PDF file. In your code, please dont submit any images or binaries. In the PDF file, in addition to writing down your discussions and analysis of different methods, please also include your name and USC ID. Archive all your submitted files into one .ZIP and submit it to DEN Digital DropBox. The name of the .ZIP file must be HW1_lastname_firstname.zip.

You might also like