In this project, I used different techniques to blend pictures together
Sharpening an image can be done by extracting higher frequencies (image - Gaussian applied to image) from an image and adding it back to the image (with an alpha factor to set the intensity of the sharpening).
|
|
|
|
If we take the higher frequencies of one image and combine it with the lower frequencies of another image, we can get a cool effect where the combined images looks like the first image from up close but the second image from afar. This is because we our eyes pick up the details (higher frequencies) of an image up close but only the general shapes (lower frequencies) of an image from far away. When using color to enhance the effect, I found that it was better to use color for just the low frequency images. here are some examples:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We can break down to frequencies in an image by using Laplacian stacks
We can then use the Laplacian stacks that we made to blend images together seamlessly. We can have a slower transition between the lower frequencies and a faster transition between the higher frequencies so that the images mix together more naturally.
|
| |
|
|
|
| |
|
|
|
| |
|
| |
|
|
We can also blend images together in the gradient domain. Since human perception is based off of relative diffidences in color (gradient) if we match the edges gradients of the target image while preserving the gradient of the source image, we are able to paste the source image into the target image pretty seamlessly.
|
|
In general, this is just one big optimization problem where you are trying to minimizes the difference in gradients between the blended image and the source image as well as the difference in gradients between the edges of the blended image and the edges of the target image. To do this I set up all the constraints in a matrix A and used least squares to find the optimal solution. Since there are so many variable, I used a sparse matrix to seed up the computation.
|
| |
|
| |
|
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
|
|
|