CS 194-26 Project 3

Albert Chen

Part 1.1: Warmup


To sharpen the image I simply applied a laplacian filter and added the result back to the original.

original sharpened

Part 1.2: Hybrid Images


To find the best cut-off frequency for the images I simply tried several different filters for each hybrid image. The standard deviations for the gaussian kernels that I experimented with were 1, 2.5, 5, and 10. I chose these pairing based on their similar shapes as well as their similar colors.

Results


sigma=1 sigma=2.5 sigma=5 sigma=10
Overall, I think that standard deviations of 5 and 10 worked the best for the lego and ship images respectively:

Fourier Transforms


original Lego brick image original brick image gaussian filtered Lego brick image laplacian filtered brick image hybrid image

Part 1.3: Gaussian and Laplacian Stacks


For the laplacian and gaussian stacks I used a standard deviation of 7 and 5 for the kernels respectively.

Gaussian Stacks


Laplacian Stacks

Part 1.4: Multiresolution Blending


To contruct the A and b matrices I used a very similar method to the Toy Problem. I constructed the coefficient matrix such that each row contained the weights of the laplacian matrix and the b matrix was the result of convolving the composed target-source image with the same laplacian matrix.

Blended Images


target source mask
target source mask
target source mask

Intermediate Step Images


target source mask

Part 2.1: Toy Problem


To contruct the coefficient matrix for the least squares solver, I created two rows for each pixel of the image in addition to one row to contrain the value of the first pixel. Each row has mxn columns, with each column representing the coefficient corresponding to that pixel. In the end, all but the last row has exactly one entry equal to 1 and another equal to -1. These coefficients come from the 1 and -1 coefficients of the contraints min( v(x,y+1)-v(x,y) - (s(x,y+1)-s(x,y)) )^2 and min( v(x+1,y)-v(x,y) - (s(x+1,y)-s(x,y)) )^2. The last row has a 1 in the first column. The b vector of the least squares solver is equaled to the flattened imaged that has been convolved with a [-1, 1] and [-1, 1]^T matrix. The last entry of the b vector is equal to the top right pixel of the original image.

Images


original solution

Part 2.2: Poisson Blending


To contruct the A and b matrices I used a very similar method to the Toy Problem. I constructed the coefficient matrix such that each row contained the weights of the laplacian matrix and the b matrix was the result of convolving the composed target-source image with the same laplacian matrix. Overall, I think these images turned out much better than the multiresolution blended pictures, because the mask is less visible and the color of the source image adjusts to the surrounding colors of the target image.

Blended Images


target source mask
target source mask
target source mask