CSC 589 Introduction to Computer Vision

Project 3: Image Blending


(The left part of the image is an apple and the right part of the image is an orange)

Brief

Overview

The goal of this project is to use image-blending techniques to seamlessly merge information from multiple images. The primary focus of this project is to have fun and experiment. You will implement Laplacian blending, a reasonably simple technique. If you are interested in pursuing this further, consider doing Poisson image blending as a final project (Perez 2003). Please talk with me about this if you are interested in perusing this as your final project. Both the original Gaussian pyramid paper and the Poisson image blending paper are attached in the homework folder for your references.

Details

Begin by acquiring images. You can acquire images from your phones and cameras, as well as download from the Internet. The apple and orange images are provided in the data folder. However, it is required you use additional images for this project. I also provided once again my GeneratePyramid.py code that we have been playing around in class.

Laplacian Pyramids. Implement functions that build and collapse Laplacian pyramids. The input to the Laplacian pyramid building function is an image and the output is both the Gaussian and Laplacian pyramids for the image. The situation is reversed for collapsing a Laplacian pyramid (but really all that is needed is the lowest level Gaussian along with all levels of the Laplacian pyramid). You can use the interpolate and decimate functions discussed in class, or you can implement your own. Note that building and collapsing a Laplacian pyramid should yield the original input image. Before you do any blending, checking whether your code can successfully collapsing into multiple sub-bands and reconstruct an image.

Create an image that shows multiple levels of the Gaussian and Laplacian pyramid of an image and include this in your write up along with an explanation of image pyramids in your own words. Laplacian Blending. Implement Laplacian image blending for a pair of images and a binary mask. In Laplacian blending, a new Laplacian pyramid is built by alpha blending each corresponding Laplacian pyramid level for the input image pairs using a Gaussian pyramid of the binary mask as the alpha mask. The lowest level of the new pyramid also includes the alpha blend of the lowest level Gaussian images in the two pyramids (you can blend all levels of the Gaussian pyramids if you want, but you technically only need the coarsest level). The resulting Laplacian pyramid is collapsed to recover the blended image.

Try your multi-scale Laplacian blending method out on several sets of images. Show at least three results you consider "good" and one you consider "poor" in your write up. For each image, discuss why you think this approach did or did not work well. You can compare your results with a simple “copy and paste” methods by directly apply mask on one image and blend with another. Submit your final code onto GitHub.

Tips

To blend a pair of images you need a source image, target image, and mask. The source image contains the data you are inserting into the target image. The mask indicates where in the output image the data comes from the source image. It helps if all three images are the same size. A simple mask can be built by dividing the image plane in half. This will blend two images together along the middle seam, which is what is done for the famous apple/orange hybrid. More advanced masks can be created using an image editing program that uses layers, such as Gimp. A simple procedure is:


Note that Gimp on the Mac is a little annoying because you have to click in a window to change focus before you can interact with the window.

Write up

For this project, and all other projects for the rest of the semester, you must do a project report in HTML. We provide you with a placeholder .html document, which you can edit. In the report you will describe your algorithm and any decisions you made to write your algorithm a particular way. Then you will show and discuss the results of your algorithm. In the case of this project, show the results of your blending algorithm and show the good and bad examples. Also, discuss anything extra you did. Feel free to add any other information you feel is relevant. If you performed this assignment as a team, please indicate this in the start of your webpage and credit each person for his/her contributions. Please do not move the highlighting folder that contains important CSS sheets (unless you want to do your own web design). Just edit the .html file and keep the folder structure when you submit your code. The details of how to setup your webpage on the AU server can be found here: http://www.american.edu/oit/network/WebPage-Students.cfm But you don’t have to have Internet to view the webpage.

Hand-in

This is very important, as you will lose points if you do not follow instructions. Every time after the first that you do not follow instructions, you will lose 5 points. The folder you hand in must contain the following:

Extra credits

Rubric