This part of the project required taking interesting blurry images and using an unsharp mask, try to sharpen the image.
Effectively the math is straigtforward and is as follows: for a blurry image b, apply a gaussian blur and get a even blurrier image g. Calculate the difference between b and g and add the difference back to b. This effectively adds definition to the features of the image that 'survived' the Gaussian blur so it should theoretically sharpen the key characteristics of the image.
Another way to think about it is the Gaussian blurr is a low pass filter. The Gaussian blur subtracted from the dirac identity (the funciton to get the original image we subtract from) is a laplcian filter which is a high pass filter. Applying a high pass filter to the original image accentuates the high frequency features such as edges and corners so this adds definition when added back to the original image.
For hybrid images, we want to merge two images so that you can see only one of the two or both overlayed depenind on how far you are. The concept is simple. From the previous part, we know a Gaussian filter is a high pass filter and laplacian is a low pass filter. If we apply a low pass on one image, high pass on another and add them together, we will get the desired hybridized affect.
Code was provided to align the images before the filters were appleid
This section visualizes the laplacian and the gaussian applied repeatedly to the image of interest. If we apply it to any hybridized image, we should be able to see the source images that make up the hybridized image
Why a cheetah? Because I thought their extra blur and seeing their edges running fast would look cool
Now we'll try to blend two images across a particular line.
Here's the pyramid for an the clownshark
You can kind of see the details of both the clownfish and the shark as they came together
In this part of the project, I simply used the toy image and reconstructed using itself as the background
The point of this part of the project is to implement Poisson pyramid blending. The idea behind this type of blending is to try to place a source image in a particular specific location in the other image. Ideally, we would have trimmed the source image accordingly and get rid of the extraneous borders. But, this technique still works with a limited boundary. Assume the source image was in a very bright area, while the background image is in a dark area. One important fact decided empirically is that humans cannot really discern the intrinsic brightness of an object. Rather, they identify and segment objects based on relative differences i.e. the gradients. So we can reshade the source image so that it kind of matches the relative intensity of the background and maintains the intrinsic changes in pixel intensity.
It worked
This one does not look as good because of the source iamges background and high contrast as opposed to the background, but you can see the adjustments made to try to get Kavi to fit in
The shark in the pool is pretty cool
The source image and background image:
The image integration works as follows. We basically set up an optimization problem. For every pixel, you try to measure the difference between the current pixel and the adjacent pixels, and try to set up the optimization problem so that the difference between each pixel and each of the adjacent pixels is as close to the difference between the pixels in the background image.
Why the shark image works? It works because the background color of both images was pretty similar and uniform. The fact that the colors were the same was probably not main reason for the succesfful integration but rather the gradients of the backgrounds were in the same. The one that turned down very poorly was the one where I tried to put my friend Kavi's face on Trumps state of the union speech. It was largely because of the background that was in a white classroom and he stood out whereas in the state of the union the people did not really stand out relative to the background. So everytime I tried to adjust the source intensity using gradient matching, he would turn out really dark relative to the background--way darker than the other people in the screen. I then tried to add a bunch of black to the background of his image so that he stood out lesss but due to my lack of artistic capability he turned out glowing. For the shark and swimmer, I tried multiple locations, tried to match histograms by equalizing both, and then put the shark on the swimming pool.
Which approach works best--the one above or the one below? This or the multiresolution blending? Definitely this one because I could adjust the location, not just blur the edges to make it seem continuous so don't lose details. Though the shark swimmer below looks pretty neat