For this part we are building the Finite Difference Operator. This is done by taking the partial derivate of the x axis and y axis. To the x axis, we will convolve the image with [1,-1]. While for the y axis, we will convolve the image with [[1],[-1]].
After getting the derivative results, we can further detect the edges. Before we do that we would need to first calculate the magnitude of the image. This can be done through taking the square root of the squared sum of dx and dy.
We notice that the result from the previous part was pretty noisy. To improve on this, we can filter the image through a low pass filter, to reduce the higher frequencies. There are two methods of conducting this. First being that we pass the gaussian filter through the image first, then taking the derivative. The results are shown below.
The second method is first convolving the gaussian filter with the derivatives, then passing the new filters through the image. This method should yield the same result as the first.
Observations:
From these operations, we can see that the noise in the edge images have decreased greatly.
In this portion, we are tasked to "sharpen" images. This process essentially extracts the high frequencies of an image and adds it back to the original image, with adjusted alpha. In lecture, it was mentioned that there are two methods to complete this.
1. Adding the higher frequencies back with adjusted to alpha.
2. Calculate ((1 + alpha) * unit impluse - alpha * gaussian filter) then convolving that with the original image
In our case, we chose to go with the first method.
Observations:
Even though the sharpened image isn't identical to the original image. We can see an improvement to the clarity of the edges.
With our knowledge in frequencies, we can also create hybrid images with them! This is by taking the high frequency of one image and overlaying that with the low frequency of another image. The results are shown below.
As we can see in the hybrid image, this is a failed case. This is due to the fact that we can't even notice the banana in the photo!
In this part we are constructing the Gaussian and the Laplacian stacks. The way to construct the Gaussian stack is that we increase the sigma at each level of the stack, thus the sigma at each level of the stack will be 2 ** l. On the other hand, the method of constructing the Laplacian stack would be to simply subtract two consecutive levels of a Gaussian stack. Thus, level l of a Laplacian stack will be level l + 1 - level l of the Gaussian stack.
We can see that the Gaussian and the Laplacian yields the same result! To be noted the recreated of figure 3.4.2, is shown in the next portion.
The coolest part of this project is understanding that even though some operations may seem very complicated. But they are actually just simple math and matrix operations!