In this project, I explored different image blending techniques that involve filtering and manipulating the frequency domain as well as blending in the gradient domain.
Sharpening means adding back details to the image. The "details" can be obtained by substracting a blurred version of our image from the original image. Then we can adding the "details" back to the original image. If the blurring processes is done using a Gaussian Filter, we can use the following kernel:
We can make hybrid images by combining the low frequncies from one image and the high frequencies of another image. Low frequencies are visible from far away and high frequencies from up close, creating a hybrid. Therefore, we can apply Glaussian on image A, which sits at the bottom. We then overlay the details from image B, obtained by Laplacian, over the top. Here I illustrate the Fourier analysis of the filtered images and the blended image I create.
Low Frequency in Image A | High Frequency in Image B | Blended Image
Catman
Trum-Pun-Un-1
Trum-Pun-Un-2
In the gaussian stack, we convolve with a gaussian with increasing sigma
at each level, so each successive image has a smaller active frequency range in the low frequencies. In the laplacian stack, we take the difference of the results in the consecutive gaussian stack.
Taking advantage of Gaussian and Laplacian stacks, we can create Laplacian stacks for two images and a Gaussian stack for a mask. At each layer we blend the two images with the mask, and then add together all the layers to create a frequency-blended image that is blended on all frequency spectrum.
CNN Exclusive: PUBG Corporation - Announcing New Assult Rifle: AWM-K14
In Part 2 we explore blending images using gradient domain fusion. We start with a simple problem - reconstruct the original image by minimizing the gradient parity between the original image and the image we are reconstructing.
Original vs Reconstructed
The error of our minimazion Av - b
is 2.6158066451483797e-05
Poisson blending makes it possible for objects to be nicely blended into a larger image. It sets the values on the boundary of the mask to the value on the destination image where the object will be placed to. Then it reconstructs the values within the mask area - like we had done in 2.1 - so that the gradients in the mask match closely to what is the source image.
To generate a realistic-looking seamless blending, it is very important for the destination image also matches the color scheme and brightness setting of the cropped object.
For results 0 - 2, this criteria almost holds and we get reasonable results. However, for results 3, as the destination image has low brightness and the lawn appears to be dark, our Leonardo is thereby affected. Also his head cuts through the road, which is sad.