This section explores filters and how we can manipulate images utilizing frequency. In regards to the gradient magnitude computations, I first convolve the image with the filter [1, -1] to get the x component, Gx, of the gradient. Then I convolve with [[1], [-1]] to get the y component of the gradient, Gy. Afterwards, I compute the square root of the sum of squares of the x and y components of the gradient to get the gradient magnitude, sqrt( Gx2 + Gy2 ). The most important thing I learned from this project is the importance of reading documentation as some plotting libraries treat image channels in a different order. Additionally, I also realized the importance of having organized and modular code.
For this section, I create a smoothing filter from the Gaussian Filter which I made by taking the dot product with itself from a 1D Gaussian filter. I also convolve the gaussian with Dx and Dy and it gives the same result.
For this section, I low pass filter the image. Then I subtract that low frequency image from the original image to get the high frequency components of the image. Then I add a small portion of the high frequency image back to the original since images look sharper if it has stronger high frequencies.
In order to create hybrid images, I low pass one image and high pass filter another image (by subtracting the low frequencies) and then combine the images. I set thresholds appropriately in order to get the desired effect.
In order to make Gaussian stacks I repeately apply Gaussian blur to the previous image in the stack. To make the Laplacian stack I take the ith image in the Gaussian stack and subtract the i+1th image from the Gaussian stack from it.
In order to blend images, I make a Laplacian stack for both images. Then I create an appropriate mask that defines the blending boundary. Then I apply Gaussian blur to the mask and create a Gaussian stack. Then I use the algorithm from the 1983 paper. This algorithm iterates through the stacks and element wise multiples the mask with the first images Laplacian stack image and then adds that to (1 - mask) element wise multipled by the second images Laplacian stack. Then, we sum over all the stacks to get the final image.