Angela Xu
In this project, we played with filters and frequencies to manipulate images. We used various techniques to blur and sharpen images, and also created some cool hybrid and blended images!
For this part, we first used finite differences to filter in x and y directions. We then used these partial derivative images to compute the gradient magnitude and edge images.
To compute the gradient magnitude, we first find the partial derivatives of both X and Y directions by convolving the image with finite difference operators.
We then find the magnitude of the gradient from the partial derivatives. The equation looks something like this:
sqrt(d_x^2 + d_y^2).
Additionally, to find the edge image, we use a threshold of 0.3 to binarize the gradient magnitude image. This means we assign white or black pixel values
depending on if they fall above or below the thresholds.
The first edge image we created had some noise, so we use a 2D Gaussian kernal to do some blurring. This can be done with 2 methods, which are shown below:
Method 1
We apply the Gaussian filter to the image, then calculate the X and Y partial derivatives.
Method 2
We calculate the X and Y partial derivatives of the Gaussian and then apply them to the original image, essentially letting us convolve with the image only once.
As we can see, both methods produce very similar results!
The difference in using the DoG filter is that the edges have smoother, more prominent lines, and there is less noise compared to before.
Now we want to try sharpening some images! Using the same Gaussian filter, we can find the high frequencies of an image by subtracting the low frequencies (the blurred image).
Then, we can add these high frequencies to the image to increase sharpness! Here are 3 examples:
Taj
We are able to combine this process into a single convolution operation called the unsharp mask filter, the equation is (1+alpha) * Unit Impulse Filter - alpha * Low Pass Filter.
Taj Using Unsharp Mask
Billy Bob (my hamster) Using Unsharp Mask
Finally, we tried blurring and then sharpening some flowers!
The final image isn't as nice as the original, but the details are still brought out of the blurry.
Time to make some cool hybrid images! By combining low frequencies of one image with the high frequencies of another, we can create
an optical illusion, tricking the mind to see one thing from a distance and something different up close. We do this by choosing
two images, aligning them, finding the high/low frequencies, and then averaging the two together.
As we'll see in one of the examples, this doesn't ~always~ work well.
Yoshi + Koopa = Yoopa
Kirby + Jiggly Puff = Kirbly...ish
This was a failure. Although the circular bodies lined up nicely, Kirby and Jiggly's facial features are positioned at very different places.
With pink skin and blue eyes being quite contrasting colors, this made it difficult to blend (you can clearly still see both).
Bert + Pineapple Under the Sea = Bert Under the Sea
We can see the log magnitude of Fourier transform of Bert Under the Sea images here:
bert pineapple high freq Bert low freq pineapple bertapple
Now we will be doing some multiresolution blending using Gaussian and Laplacian Stacks.
We start with 2 images and a mask. We make 5 layers of Gaussian stacks by convolving a Gaussian over and over. We make
5 layers of Laplacian stacks by subtracting each Gaussian layer by the layer that follows it, with the final Laplacian
being equal to the final Gaussian. The process is illustrated below with the apple and orange!
Yay...an oraple!
Here are some more examples, using different images and masks. Very fun!
Goomba + Cupcake = Goomcake
Bunny + Bread = Bunbread
I learned a lot from this project and really enjoyed making my own creations! This
project involved a lot of experimentation, from testing different Gaussian kernals
and thresholds to utilizing different methods of convolving and combining filters and
frequencies. Overall, it was very cool to be able to implement common features such as
layer masks and blending. I now have a deeper understanding of how these popular
photo-editing functions work! :D