Project Description
In this project, I explored the concepts of 2D convolutions, filtering, and image processing. The project is split into two major parts: Fun with Filters and Fun with Frequencies, where I applied various filters and frequency manipulations to generate meaningful results and visualizations. Below are the results and explanations for each part of the project.
Part 1: Fun with Filters
Part 1.1: Finite Difference Operator
Using the finite difference operator, I computed the partial derivatives of the Cameraman image in the x and y directions using dx,dy = [1, -1], followed by calculating the gradient magnitude and applying a threshold to create an edge-detected image.
Part 1.2: Derivative of Gaussian (DoG) Filter
First, I used a Gaussian filter to blur the original image by convolving with a Gaussian, and then finding partial derivatives in x and y. The result contains smoother, cleaner, and thicker edges. We have less noise and more accurate edge detection overall.
Then, instead of convolving twice, I created a derivative of the gaussian filters and then applied to to the image. Result is pretty similar but a bit more accurate with a bit less noise.
Part 2: Fun with Frequencies
Part 2.1: Image "Sharpening"
In this section, I used unsharp masking to sharpen images. This involves subtracting the low frequencies from an image to isolate the high frequencies, scaling the high frequencies up, and then adding them back to the original image to emphasize the high frequencies. Below are the results:
Part 2.2: Hybrid Images
In this part, I created hybrid images by combining the low-frequency and high-frequency information of two different images. Note that although the Kakashi (anime ninja guy) image does not seem to show happy Kakashi that well, it actually shows up quite well when you are at a far distance, in more than just the eye.
These results are my favorite, so below I have listed more detailed frequency analysis of both images.
Part 2.3: Gaussian and Laplacian Stacks
Laplacian stacks are created from the two input images, an apple and an orange. I then generate a gaussian stack from the mask image. Using this gaussian stack of masks and the laplacian stacks for both images, I blend at each frequency level and then concatenate the final blended stack for a final blended image, the oraple.
Part 2.4: Multiresolution Blending with Irregular Masks - Monster Kevin Hart and Steph Curry, the Chosen One
Similar process at part 2.3, however I use an irregular mask in this case. For example, in the Steph Curry with Lebron Jersey blend, the mask is black everywhere except over Lebron's Cavs jersey, where it is white. We then use this irregular mask's Gaussian stack and the laplacian stacks of the two input images to create a blend. For the Kevin Hart/Yao+Shaq blend, the mask covers Yao and Shaq's bodies and is black everywhere else.
Using irregular masks - kevin hart and shaq and yao
Since this was my favorite result, here are the laplacian stacks.