Project 2: Fun with Filters and Frequencies

Part 1.1 Finite Difference Operator

In this part, we show the convolution of the cameraman photo with the finite difference operators D_x and D_y. Further, we compute the gradient magnitude of the image to get the edges of the image. To further supress noise and maximize our edge output, we binarize the image by changing all values in the gradient magnitude edges to be either [0,1] based on a threshold


The order of the images are as follows:





For the threshold, after trial and error I found that the value 0.26 was best

Part 1.2 Derivative of Gaussian (DoG) Filter

As seen in the images above, the results are rather noisy. In order to make our edges more sharp, we will apply a Gaussian Filter to first blur the image. This will allow us to remove initial noise. We will proceed with the same steps as above afterwards.


The order of the images are as follows after the image has been smoothed:




As we can see, there is much less noise compared to the images in 1.1 as the smoothing already removes most of the noise. Another observation to make is that the threshold value is now 0.1 because most of the lower frequencies have already been removed through smoothing.

Part 2.1 Image Sharpening

In this part we sharpen an image by using the unsharp masking technique. Our approach here is to use a low pass filter (gaussian in this case) to retain only te low frequencies. Afterwords, we can obtain the high frequencies by subtracting the original image with the blurred image. This essentially becomes our high pass filter. To sharpen the image, we essential want the edges (high frequencies) to be amplified. To accomplish this, we will add the high frequencies of the iamge back into the original image


The order of the images are as follows:





The following images are the same order as above, but with a photo that I took myself in Seattle!




As we can see, the edges in both images appear to be more sharp. This is because edges are generally higher frequencies.

Part 2.2 Hybrid Images

In this part, we create a hybrid image such that the image will appear to look like one figure up close but another far away. To accomplish this, we need one image with low frequencies and another with high. We apply our low-pass gaussian filter to one image to get one image with low frequencies. We get the high frequencies of our second image by subtracting the original image from a low-pass gaussian filter of the second image. Lastly, we average the images together to create the hybrid image


The order of the images are as follows:




In addition, I also made two more hybrid images. The first one is as follows:




The second hybrid image is as follows:



In addition, we present the frequency analysis of the sahai/raccoon hybrid image with the fourier transform of the images. The order of the images are as follows:





Part 2.3 Gaussian and Laplacian stacks

In this part, we attempt to merge two images together seamlessly by utilizing gaussian and laplacian stacks. We create the gaussian stacks by applying the gaussian filter on the original image with 5 different sigma values: 1,2,4,6, and 8. We then create the laplacian stack by subtracting consecutive gaussian stacks to isolate only one level of the frequency. For each laplacian layer, we combine both images with our gaussian mask. The mask in this case consists of half 0s and half 1s. Further, the gaussian stack is applied to the mask. Each layer is summed as follows:


CombinedImage(i,j) = GaussianMask(i,j)*LaplacianImage1(i,j) + (1 - GaussianMask(i,j))*LaplacianImage2(i,j))


The images are as follows with apple on the first column, orange on second, and combined on third






Part 2.4 Multiresolution Blending

In this part, we combine all the combined masked laplacian combination levels above by adding all the layers. I present the world: the oraple...

Most important thign I've learned

I learned how easily tricked our brains can be due to the frequencies of images. It was fun to see the hybrid images form together and present different images based on distance. Lastly, I learned that I can now morph images together and will now proceed to create absurd items just like the oraple.