Project 2 writeup
Alex Hills (ahills)
February 18, 2010
Poisson image blending combines two pictures using a mask to determine what parts of a source image should be blended with what in a target image. The simplest description of it is that the color gradient of the source image is used to bleed the colors of the target image to recreate the source image, while maintaining a smooth blend. Sharp edges distract the eye, and make a viewer think that something doesn't belong.
This algorithm involves finding the solution to a poisson system, where each pixel in the target image under the mask is dependent only on its neighbors and the color gradient from the source image. This creates a large system of linear equations (equivalent to the number of pixels to the image, a very large matrix). Thus, the only real way to do this (and not take up a completely unreasonable amount of space) is to use a sparse matrix.
- One psuedo-extra credit I did is to use the construction sparse(i,j,s,m,n,nze). I sped up the algorithm such that I can process even 1700x1200 images in less than five seconds (the jet image takes less than a second). This allocates the exact amount of space needed for a sparse matrix of the size you've specified (nze=#nonzero elements). i is a vector of row indicies, j is a vector of column indicies, and s is the values at said indicies. m and n are the dimensions of the matrix.
- I also implemented both a single image blend, and the mixed gradient image blend. I've compared all the images here (left is without the blend, and right is with it):