CS194-26 Project 2: Fun with Filters and Frequencies! (Ujjaini Mukhopadhyay)
Part 1: Fun with Filters
Part 1.1: Finite Difference Operator
Gradient Magnitude Computation
Gradient Magnitude Computation is integral to edge finding. To compute the gradient, we can use can use a convolution with horizontal/vertical filters (depending on direction) of [1, -1]. Finding the magnitude allows us to understand how big the slope is. To do so, I take the matrix muliplication of the two gradients with each other and take a square root of that value.
Here is the partial derivative in X and Y:
Here is the magnitude and binarized magnitude by setting the threshold at 0.23:
Part 1.2: Derivative of Gaussian (DoG) Filter
Instead, we blur the image before applying a the convolutions of the derivative and binarizing. Here are the results:
We can also combine the blurring to the derivative filters and only do one convolution. They provide almost exact same results:
Here we see that the edges are much clearer and bolder as opposed to the non-blurred version above. The following are the DoG filters as images:
Part 2: Fun with Frequencies!
Part 2.1: Image "Sharpening"
Here we focus on Image Sharpening -- however, how sharp the image becomes depends on alpha. Making alpha too big will result in an unrealistic image as shown below:
Here is an example of oversharpening:
Here is another example image where we will attempt to blur and re-sharpen:
Part 2.2: Hybrid Images
Hybrid images contain a mashup of two or more images filtered at different frequencies so that with distance, the image appears different to the human eye. This is evidenced by the contrast sensitivity curve which shows us that certain frequencies are not comprehensible by the human brain. These frequencies change with distance, thus giving the appearance of a hybrid image.
Here is the given example:
Here are some of my results for this part:
Here is a fail. This probably didn't work because alignment didn't really exist and teh frequencies are pretty close together.
Here is how the image is developed with another example:
I start with this picture of one of my closest friends (Priyanka).
Thus it has the following Fourier frequencies:
I put it through a Low Pass filter to create the following image and frequencies:
I then load in this picture of myself which I will run a High Pass Filter through:
Thus it has the following Fourier frequencies:
I put it through a Low Pass filter to create the following image and frequencies:
Then I can put them together to create the following picture and frequencies:
Bells and Whistles: Color
By computing the convolution once for every channel and stacking them at the end, I'm able to play with hybrid images in color. Of course, this is more difficult, because the colors now have to match up.
Multi-resolution Blending and the Oraple journey
Part 2.3: Gaussian and Laplacian Stacks
By creating Laplacian stacks and a guassian blur for the mask, we can create the following grayscale image:
Bells and Whistles: Color
If we do the same manipulations but this time three times (once for every color channel), we can do the same blending in the color space.
Part 2.4: Multiresolution Blending (a.k.a. the oraple!)
Together this creates:
This is a significant difference from
Applying different kinds of masks with different images, we can see:
We can also apply a circular mask:
Especially in the last picture, we see how using color allows us to create more interesting photos, and while the blend on the grayscale is perhaps easier to achieve, especially when two images are two different colors (see "From Sea to Shining Sea"), the effect is definitely not as satisfying.
Through this project, I learned a lot about picking compatible images to make creative blends or hybrids